#include <bits/stdc++.h>
int main(void) {
  int i;
  int n;
  int prime[10000];
  int j = 0;
  int counter = 0;
  prime[j++] = 2;
  prime[j++] = 3;
  scanf("%d\n", &n);
  for (n = 5; n <= 100000; n += 2) {
    for (i = 1; i < j; i++) {
      if (n % prime[i] == 0) break;
    }
    if (j == i) prime[j++] = n;
    counter++;
  }
  for (i = 0; i < j; i++) scanf("%d\n", &counter);
  return (0);
}
