#include <bits/stdc++.h>
using namespace std;
int di[] = {0, 0, 0, -1, 1}, dj[] = {0, 1, -1, 0, 0};
int gcd(int a, int b) { return b == 0 ? a : gcd(b, a % b); }
int lcm(int a, int b) { return a * (b / gcd(a, b)); }
int a[1009];
void fun() {
  a[0] = a[1] = 0;
  for (int i = 2; i < 1009 / i; i++) {
    if (a[i]) {
      for (int j = i * i; j < 1009; j += i) {
        a[j] = 0;
      }
    }
  }
}
int main() {
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  memset(a, 1, sizeof(a));
  fun();
  vector<int> v;
  for (int i = 2; i <= n; i++) {
    if (a[i]) {
      v.push_back(i);
      int j = i;
      while (j * i <= n) {
        j *= i;
        v.push_back(j);
      }
    }
  }
  cout << (int)v.size() << endl;
  for (int i = 0; i < (int)v.size(); i++) cout << v[i] << " ";
  return 0;
}
