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