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