#include <bits/stdc++.h>
using namespace std;
long long int power(long long int number, long long int tavan) {
  long long int ans = 1;
  for (long long int i = 1; i <= tavan; i++) ans *= number;
  return ans;
}
vector<long long int> arr;
int main() {
  long long int n;
  cin >> n;
  for (long long int i = 2; i <= n; i++) {
    int check = 1;
    for (long long int j = i - 1; j > 1; j--)
      if (i % j == 0) check = 0;
    if (check == 1) arr.push_back(i);
  }
  long long int finalans = 0;
  for (long long int i = 0; i < arr.size(); i++) {
    finalans++;
    if (power(arr[i], 2) <= n) finalans++;
    if (power(arr[i], 3) <= n) finalans++;
    if (power(arr[i], 4) <= n) finalans++;
    if (power(arr[i], 5) <= n && arr[i] < 4) finalans++;
    if (power(arr[i], 6) <= n && arr[i] < 4) finalans++;
    if (power(arr[i], 7) <= n && arr[i] == 2) finalans++;
    if (power(arr[i], 8) <= n && arr[i] == 2) finalans++;
    if (power(arr[i], 9) <= n && arr[i] == 2) finalans++;
  }
  cout << finalans << endl;
  for (long long int i = 0; i < arr.size(); i++) {
    cout << arr[i] << " ";
    if (power(arr[i], 2) <= n) cout << power(arr[i], 2) << " ";
    if (power(arr[i], 3) <= n) cout << power(arr[i], 3) << " ";
    if (power(arr[i], 4) <= n) cout << power(arr[i], 4) << " ";
    if (power(arr[i], 5) <= n && arr[i] < 4) cout << power(arr[i], 5) << " ";
    if (power(arr[i], 6) <= n && arr[i] < 4) cout << power(arr[i], 6) << " ";
    if (power(arr[i], 7) <= n && arr[i] == 2) cout << power(arr[i], 7) << " ";
    if (power(arr[i], 8) <= n && arr[i] == 2) cout << power(arr[i], 8) << " ";
    if (power(arr[i], 9) <= n && arr[i] == 2) cout << power(arr[i], 9) << " ";
  }
  return 0;
}
