import java.util.*; public class Exercise150{ public static void main (String[] args){ Scanner sc = new Scanner(System.in); int a = sc.nextInt(); if(a - 7 < 8){ System.out.println(-1); }else{ System.out.println(a - 7); } } }