#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, j = 0;
  cin >> n;
  vector<int> ai(n);
  if (n == 4) {
    cout << 4 << '\n';
    cout << 3 << " " << 1 << " " << 4 << " " << 2 << '\n';
    return 0;
  }
  for (int i = 1; i <= n; i += 2) {
    ai[j] = i;
    j++;
  }
  for (int k = 2; k <= n; k += 2) {
    if (abs(ai[j - 1] - k) != 1) {
      ai[j] = k;
      j++;
    }
  }
  cout << j << '\n';
  for (int i = 0; i < j; i++) cout << ai[i] << " ";
  cout << '\n';
  return 0;
}
