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