N = raw_input() X = -1 if N-7 >= 2: X = N-7 print X