#include <bits/stdc++.h>
using namespace std;
const int inf = 100010;
const int MOD = 1000000007;
const double pi = acos(-1.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 fx[] = {0, 0, 1, -1};
int fy[] = {-1, 1, 0, 0};
int arr[inf];
int main() {
  ios_base::sync_with_stdio(0);
  int i = 0, j;
  int n, t, cnt = 0;
  cin >> n;
  arr[0] = arr[1] = 1;
  vector<int> ans;
  for (i = 2; i <= n; i++) {
    if (!arr[i]) {
      ans.push_back(i);
      for (j = i * i; j <= n; j *= i) {
        arr[j] = 1;
        ans.push_back(j);
      }
      for (j = i + i; j <= n; j += i) {
        arr[j] = 1;
      }
    }
  }
  cout << ans.size() << "\n";
  for (i = 0; i < ans.size(); i++) {
    cout << ans[i] << " ";
  }
  return 0;
}
