import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import static java.lang.System.in; public class Main { public static void main(String[] args) throws IOException { BufferedReader reader = new BufferedReader(new InputStreamReader(in)); int A = Integer.parseInt(reader.readLine()); int answer = -1; for (int i = 1; i <= A - 7; i++) { if (A % i == 7 && A / i == 1) { answer=i; } } System.out.println(answer); } }