def f(n):
if n == 0 or n == 1: return 0
if n >= 2: return f(n-2) + 1
while True:
try:
num = int(input().strip())
if num:
print(f(num))
except:
break
def f(n):
if n == 0 or n == 1: return 0
if n >= 2: return f(n-2) + 1
while True:
try:
num = int(input().strip())
if num:
print(f(num))
except:
break