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