#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  if (n == 4) {
    printf("4\n");
    printf("2 4 1 3\n");
    return 0;
  }
  int cnt = 0;
  vector<int> V;
  int last = -1;
  for (int i = 1; i <= n; i += 2) {
    if (abs(last - i) != 1) {
      V.push_back(i);
      last = i;
    }
  }
  for (int j = 2; j <= n; j += 2) {
    if (abs(last - j) != 1) {
      V.push_back(j);
      last = j;
    }
  }
  printf("%d\n", V.size());
  for (int i = 0; i < V.size(); i++) printf("%d ", V[i]);
  printf("\n");
  return 0;
}
