#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, a[5001];
  cin >> n;
  if (n == 1)
    cout << 1 << endl << 1;
  else {
    a[1] = 2;
    for (int k = 2; k <= n / 2; k++) a[k] = a[k - 1] + 2;
    a[n / 2 + 1] = 1;
    for (int k = n / 2 + 2; k <= n; k++) a[k] = a[k - 1] + 2;
    for (int k = 1; k <= n; k++)
      if (a[k] - 1 == a[k + 1]) {
        int j = a[k];
        a[k] = a[n];
        a[n] = a[k];
        n--;
      }
    cout << n << endl;
    for (int k = 1; k <= n; k++) cout << a[k] << " ";
  }
  return 0;
}
