#include <bits/stdc++.h>
using namespace std;
long long a, b, c, x, ans, n;
bool arr[2000];
bool hidden[2000];
bool prime(int x) {
  for (int i = 2; i < x; i++) {
    if (x % i == 0) return false;
  }
  return true;
}
int main() {
  cin >> n;
  for (int i = 2; i <= n; i++) {
    if (prime(i)) {
      int cur = i;
      while (cur <= n) {
        arr[cur] = true;
        cur *= i;
      }
    }
  }
  for (int i = 2; i <= n; i++)
    if (arr[i]) ans++;
  cout << ans << endl;
  for (int i = 2; i <= n; i++)
    if (arr[i]) cout << i << " ";
  return 0;
}
