import sys import math input = lambda: sys.stdin.readline().rstrip() # ----------------------- # n = int(input()) if n % 2 == 0: print(n//2) else: if n % 4 == 3: print(math.ceil(n/2)//2) else: print(math.ceil(n/2)//2 + 1)