#include <bits/stdc++.h>
using namespace std;
int n;
vector<int> v;
int main() {
  cin >> n;
  if (n == 4)
    cout << "4\n3 1 4 2";
  else {
    for (int i = 1; i <= n; i += 2) {
      v.push_back(i);
    }
    for (int i = 2; i <= n; i += 2) {
      if (abs(v[v.size() - 1] - i) > 1) v.push_back(i);
    }
    cout << v.size() << '\n';
    for (int i = 0; i < v.size(); i++) cout << v[i] << " ";
  }
  return 0;
}
