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