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