import java.io.*; import java.util.*; import java.math.*; class Main { public static void out (Object o) { System.out.println(o); } public static int solve (int n) { if (n % 2 == 0) return n / 2; for (int i = 3; i * i <= n; i += 2) if (n % i == 0) return n / i; return 1; } public static void main (String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String[] line = br.readLine().split(" "); out(solve(Integer.parseInt(line[0]))); } }