#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<int> v;
  bool g;
  int n, m[5001] = {0}, x;
  cin >> n;
  if (n % 2 == 1) {
    v.push_back(1);
    m[1] = 1;
  } else {
    v.push_back(2);
    m[2] = 1;
  }
  while (true) {
    g = false;
    for (int i = 1; i <= n; i++) {
      if (!m[i] && abs(v.back() - i) != 1) {
        v.push_back(i);
        m[i] = 1;
        g = true;
      }
    }
    if (!g) break;
  }
  cout << v.size() << "\n";
  for (int i = 0; i < v.size(); i++) cout << v[i] << " ";
  return 0;
}
