N = int(input()) if N % 2 == 0: print(N // 2) else: q, r = divmod(N + 1, 4) ans = q + (1 if r >= 2 else 0) print(ans)