问题 AU: 集体心态(简单版)

内存限制:256 MB 时间限制:1 S
题面:传统 评测方式:文本比较 上传者:
提交:3 通过:3

题目描述

今晚是大脑晚餐之夜,所有僵尸都会聚集在一起,吃掉一些美味的大脑。狡猾的海蒂打算伪装成他们中的一员,隐姓埋名地破坏派对。她的ob目标是至少用一个大脑逃跑,这样她就可以在家里分析僵尸的心态并获得战略优势。他们今晚

将成为N位客人: N -1个真正的僵尸和一个假的,我们的海蒂。每个参与的客人等级都有一个独特的等级,范围从1到N -1,而与其他人仍然略有不同的海蒂被归为最高等级N。今晚将有一个展示大脑的箱子,每个与会者都会看到有多少。然后,这些将根据以下程序在与会者之间分配:
最高等级的僵尸会建议谁得到多少个大脑(每个大脑都是不可分割的实体)。随后进行投票。如果至少有一半的与会者接受了这个提议,大脑就会以建议的方式共享,盛宴就开始了。但是如果没有达到多数,那么排名最高的僵尸就会被杀死,而等级中的下一个僵尸必须提出建议。如果他也被杀了,那么排名第三的人就会投出一个,依此类推(正好有一半的票就足够了——如果平局,排名最高的活着的僵尸的票算两次,他会当然投票赞成他自己的建议以保持活力。)
你应该知道僵尸是非常贪婪和狡猾的,他们也知道这一点——基本上所有的僵尸大脑都是一样的。因此,僵尸永远不会接受对他来说不是最理想的提议。也就是说,如果一个提议严格来说不比以后的潜在提议更好,他就会投反对票。别搞错了:虽然僵尸通常看起来很呆板,但今晚它们的智力是完美的。今晚每个僵尸的优先级按降序排列。

1.在事件中幸存下来(他们已经经历过一次死亡并且知道这并不好玩),

2.获得尽可能多的大脑。

海蒂先走,必须提出一个至少有一半的与会者会接受的提议,并且至少为海蒂自己分配一个大脑。
要做到这一点,箱子最少需要多少个大脑?


Tonight is brain dinner night and all zombies will gather together to scarf down some delicious brains. The artful Heidi plans to crash the party, incognito, disguised as one of them. Her objective is to get away with at least one brain, so she can analyze the zombies' mindset back home and gain a strategic advantage.


They will be N guests tonight: N-1 real zombies and a fake one, our Heidi. The living-dead love hierarchies as much as they love brains: each one has a unique rank in the range 1 to N-1, and Heidi, who still appears slightly different from the others, is attributed the highest rank, N. Tonight there will be a chest with brains on display and every attendee sees how many there are. These will then be split among the attendees according to the following procedure:
The zombie of the highest rank makes a suggestion on who gets how many brains (every brain is an indivisible entity). A vote follows. If at least half of the attendees accept the offer, the brains are shared in the suggested way and the feast begins. But if majority is not reached, then the highest-ranked zombie is killed, and the next zombie in hierarchy has to make a suggestion. If he is killed too, then the third highest-ranked makes one, etc. (It's enough to have exactly half of the votes — in case of a tie, the vote of the highest-ranked alive zombie counts twice, and he will of course vote in favor of his own suggestion in order to stay alive.)
You should know that zombies are very greedy and sly, and they know this too — basically all zombie brains are alike. Consequently, a zombie will never accept an offer which is suboptimal for him. That is, if an offer is not strictly better than a potential later offer, he will vote against it. And make no mistake: while zombies may normally seem rather dull, tonight their intellects are perfect. Each zombie's priorities for tonight are, in descending order:
  1. survive the event (they experienced death already once and know it is no fun),
  2. get as many brains as possible.
Heidi goes first and must make an offer which at least half of the attendees will accept, and which allocates at least one brain for Heidi herself.
What is the smallest number of brains that have to be in the chest for this to be possible?
Input
The only line of input contains one integer: N, the number of attendees (1≤N≤109).
Output
Output one integer: the smallest number of brains in the chest which allows Heidi to take one brain home.
Examples
Input
1
Output
1
Input
4
Output
2

输入格式

唯一的输入行包含一个整数:N,参加者的数量(1≤ N ≤10^9

输出格式

输出一个整数:允许Heidi将一个大脑带回家的箱子最少数量的大脑。

输入样例 复制

1

输出样例 复制

1