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