n = int(input()) if n == 2: print(0) elif n == 3: print(2) else: print(n - 3)