A = int(input().strip()) print(-1 if (A <= 7 or A - 7 < 7) else A - 7)