#include <stdio.h>

int main(void)
{
  int i, n;

  printf("How many? ");
  scanf("%d", &n);

  for(i = 0; i < n; i++) {
    if (i % 2 == 0 || i % 3 == 0 || i % 5 == 0 || i % 7 == 0) continue;
    printf("%d ", i);
  }

  return 0;
}