跳到主要内容
图灵 OJTURING / ONLINE JUDGE

#F1182. Collective Mindsets (medium)

    ID: 1188 传统题 2000ms 256MiB 尝试: 0 已通过: 0 难度: 8 上传者: 标签>待分类整理状态挑战难度共享题库Codeforces英文题面题目来源题面语言

Collective Mindsets (medium)

题目描述

A2. Collective Mindsets (medium)
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

Way to go! Heidi now knows how many brains there must be for her to get one. But throwing herself in the midst of a clutch of hungry zombies is quite a risky endeavor. Hence Heidi wonders: what is the smallest number of brains that must be in the chest for her to get out at all (possibly empty-handed, but alive)?

The brain dinner night will evolve just as in the previous subtask: the same crowd is present, the N-1 zombies have the exact same mindset as before and Heidi is to make the first proposal, which must be accepted by at least half of the attendees for her to survive.

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 merely survive.

Examples
Input
1
Output
0
Input
3
Output
1
Input
99
Output
49


题目来源:fps-www.educg.net-codeforce-1-2833.xml.zip;FPS 共享题包,题包内第 655 题。保留原作者与原赛事署名。