# No.395 永遠の17歳 a = int(input()) print(a - 7 if a > 7 * 2 else -1)