A = int(input()) if A-7 < 8: print(-1) exit() print(max(-1,A-7))