#include <bits/stdc++.h>
using namespace std;
bool primos[1010];
bool vis[1010];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  for (int i = 2; i <= n; i++) {
    for (int j = 2; j < i; j++) {
      if (i % j == 0) {
        primos[i] = 1;
        break;
      }
    }
  }
  int ans = 0;
  for (int i = 2; i <= n; i++) {
    if (primos[i]) continue;
    for (int j = i; j <= n; j *= i) {
      if (vis[j]) continue;
      ans++;
      vis[j] = true;
    }
  }
  cout << ans << "\n";
  for (int i = 2; i <= n; i++) {
    if (primos[i]) continue;
    for (int j = i; j <= n; j *= i) {
      if (!vis[j]) continue;
      cout << j << " ";
      vis[j] = false;
    }
  }
}
