#include <bits/stdc++.h>
using namespace std;
int N, K;
bool good[1050];
int main() {
  scanf("%d", &N);
  for (int i = 2; i <= N; i++) {
    bool isp = true;
    for (int j = 2; j < i; j++)
      if (i % j == 0) {
        isp = false;
        int x = i;
        while (x % j == 0) x /= j;
        if (x == 1) good[i] = true;
        break;
      }
    if (isp) good[i] = true;
    if (good[i]) ++K;
  }
  printf("%d\n", K);
  for (int i = 2; i <= N; i++)
    if (good[i]) printf("%d ", i);
  return 0;
}
