def main(): A = int(input()) x = A - 7 if x % 2 or x < 0: print(-1) else: print(x) main()