#include <bits/stdc++.h>
using namespace std;
const int MAXN = (int)1e6 + 7;
const int INF = (int)1e9 + 7;
int main() {
  int n;
  scanf("%d", &n);
  vector<int> ans;
  for (int i = 1; i <= n; i += 2) ans.push_back(i);
  reverse(ans.begin(), ans.end());
  int st = n;
  if (st & 1) --st;
  if (abs(st - ans.back()) == 1) st -= 2;
  for (int i = st; i >= 2; i -= 2) {
    ans.push_back(i);
  }
  printf("%d\n", ans.size());
  for (auto it : ans) printf("%d ", it);
  return 0;
}
