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