#!/usr/bin/env python3 n, k = map(int,input().split()) for d in range(n, 1-1, -1): if n % d == 0 and d * 2 <= n: print(d) break