#coding: utf-8 #yuki395 a=int(raw_input()) x=a-7 if x<8: print -1 else: print x