#include <bits/stdc++.h>
using namespace std;
int a[5005];
int main() {
  int i, j, n, m = 0, cur = 0;
  scanf("%d", &n);
  for (i = 2; i <= n; i += 2) a[cur++] = i;
  for (i = 1; i <= n; i += 2) a[cur++] = i;
  for (i = 0; i < cur - 1; i++)
    if (abs(a[i] - a[i + 1]) == 1) {
      a[i] = 0;
      m++;
    }
  printf("%d\n", cur - m);
  for (i = 0; i < cur; i++)
    if (a[i]) printf("%d ", a[i]);
  printf("\n");
  return 0;
}
