#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  int n;
  cin >> n;
  int ar[n + 2];
  if (n <= 4) {
    if (n == 2 || n == 1) {
      cout << 1 << endl;
      cout << 1 << endl;
    }
    if (n == 3) {
      cout << 2 << endl;
      cout << 1 << " " << 3;
    }
    if (n == 4) {
      cout << 4 << endl;
      cout << 3 << " " << 1 << " " << 4 << " " << 2 << endl;
    }
  } else if (n % 2 == 0) {
    cout << n << endl;
    for (int i = n - 1; i >= 1; i -= 2) cout << i << " ";
    for (int i = n; i >= 2; i -= 2) cout << i << " ";
  } else {
    cout << n << endl;
    for (int i = n; i >= 1; i -= 2) cout << i << " ";
    for (int i = n - 1; i >= 1; i -= 2) cout << i << " ";
  }
}
