const
  MAX = 10000000;
var
  a, b, k, i, j, cnt : integer;
  bad : array[1..MAX] of boolean;
begin
  reset(input, 'sqfree.in');
  rewrite(output, 'sqfree.out');
  read(k);
  read(a, b);
  assert((1 <= a) and (a <= b) and (b <= MAX));
  for i := 2 to b do begin
    if (i * i > b) then break;
    j := i * i;
    while (j <= b) do begin
      bad[j] := true;
      j := j + i * i;
    end;
  end;
  cnt := 0;
  for i := a to b do begin
    if not(bad[i]) then
      cnt := cnt + 1;
    if (cnt = k) then begin
      writeln(i);
      halt;
    end;
  end;
  assert(false);
end.