n = int(input())
if n%2 == 1:
    print(n//2)
    exit()
if (n//2)%2 == 0:
    print(n//2)
else:
    print(n//2 - 1)