import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines from collections import defaultdict from operator import mul from functools import reduce N,K = map(int,read().split()) factor = [defaultdict(int) for _ in range(N+1)] for p in range(2,N+1): if factor[p]: continue q = p while q <= N: for i in range(q,N+1,q): factor[i][p] += 1 q *= p fN = factor[N] pN = fN.keys() best = 0 answer = 0 for n in range(2,N): f = factor[n] common = sum(min(f[p], fN[p]) for p in pN) if common < K: continue div_cnt = reduce(mul, (x+1 for x in f.values())) if div_cnt > best: best = div_cnt answer = n print(answer)