def judge(n): x = n - 7 if x <= 7: return -1 else: return x def main(): n = int(raw_input()) print(judge(n)) main()