#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  if (a % b == 0) {
    return b;
  } else {
    return gcd(b, a % b);
  }
}
long double area(long double x1, long double y1, long double x2, long double y2,
                 long double x3, long double y3) {
  return abs(x1 * (y2 - y3) + x2 * (y3 - y1) + x3 * (y1 - y2)) / 2;
}
bool isPalindrome(string s) {
  long long len = s.size();
  len = (len + 1) / 2;
  for (long long i = 0; i < len; ++i) {
    if (s[i] != s[(long long)s.size() - 1 - i]) {
      return 0;
    }
  }
  return 1;
}
int main() {
  vector<bool> sieve(1e3 + 1, 1);
  sieve[0] = 0, sieve[1] = 0;
  for (long long i = 2; i * i <= 1e3; ++i) {
    if (sieve[i]) {
      for (long long j = i * i; j <= 1e3; j += i) {
        sieve[j] = 0;
      }
    }
  }
  long long n;
  cin >> n;
  vector<long long> ques;
  set<long long> ans;
  vector<bool> ask(n + 1, 1);
  for (long long i = 2; i < n + 1; ++i) {
    if (sieve[i]) {
      ques.push_back(i);
      long long x = i;
      while (x * i <= n) {
        x *= i;
        ques.push_back(x);
      }
    }
  }
  cout << ques.size() << "\n";
  for (long long i = 0; i < (long long)ques.size(); ++i) {
    cout << ques[i] << " ";
  }
}
