#include <bits/stdc++.h>
int main() {
  int i, number;
  int flag = 0;
  scanf("%d", &number);
  for (i = 2; i < number; ++i) {
    if (number % i == 0) {
      flag = 1;
      break;
    }
  }
  if (flag == 0) {
    printf("%d\n", number);
  }
  return 0;
}
