N = int(input()) - 7 print(N if N >= 8 else -1)