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