#include <bits/stdc++.h>
using namespace std;
const int N = 1005;
bool nprime[N];
vector<int> ans;
int main() {
  int n;
  cin >> n;
  for (int i = 2; i <= n; i++) {
    if (!nprime[i]) {
      long long val = i;
      while (val <= n) {
        ans.push_back(val);
        val *= i;
      }
      for (int j = 2; i * j <= n; j++) {
        nprime[i * j] = 1;
      }
    }
  }
  cout << (int)(ans).size() << endl;
  for (int x : ans) {
    cout << x << " ";
  }
  return 0;
}
