#include <bits/stdc++.h>
using namespace std;
int arr[10000007] = {0};
vector<int> v;
int main() {
  int n, i, j;
  cin >> n;
  if (n == 1)
    cout << "0" << endl;
  else if (n == 2)
    cout << "1" << endl << "2" << endl;
  else {
    for (int j = 2; j <= n; j++) {
      int value = j;
      int flag = 0;
      for (int k = 2; k <= value; k++) {
        int cnt = 0;
        while (value != 0 && value % k == 0) {
          value = value / k;
          cnt++;
        }
        if (arr[k] < cnt) {
          arr[k] = cnt;
          flag = 1;
        }
      }
      if (flag == 1) v.push_back(j);
    }
    cout << v.size() << endl;
    for (i = 0; i < v.size(); i++) cout << v[i] << " ";
    cout << endl;
  }
}
