a = int(input()) print(a - 7 if a > 14 or a - 7 >= 1 else -1)