A = int(input()) if A < 8: print(-1) else: print(A - 7)