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