#include <bits/stdc++.h>
using namespace std;
bool isPrime(int num) {
  if (num == 1) return false;
  if (num == 2) return true;
  if (num % 2 == 0) return false;
  for (int i = 3; i < sqrt(num); i += 2) {
    if (num % i == 0) {
      return false;
    }
  }
  return true;
}
int main() {
  int n;
  cin >> n;
  int count = 0;
  for (int i = 0; i < n; i++) {
    int a = 0;
    cin >> a;
    if (isPrime(a)) {
      count++;
      cout << a << endl;
    }
  }
  cout << count << endl;
  return 0;
}
