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