#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a[n];
  if (n <= 2) {
    cout << "1" << endl;
    cout << "1";
  } else if (n == 3) {
    cout << 2 << endl;
    cout << 1 << " " << 3;
  } else {
    if (n == 4) {
      cout << 4 << endl;
      cout << 2 << " " << 4 << " " << 1 << " " << 3;
    } else {
      cout << n << endl;
      a[4] = 2;
      a[3] = 4;
      a[2] = 1;
      a[1] = 3;
      for (int i = 5; i <= n; i++) {
        a[i] = i;
        if (abs(a[i] - a[i - 1]) == 1) {
          int temp = a[i];
          a[i] = a[i - 4];
          a[i - 4] = temp;
        }
      }
      for (int i = n; i >= 1; i--) cout << a[i] << " ";
    }
  }
  return 0;
}
