#include <bits/stdc++.h>
using namespace std;
void solve();
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  cout << fixed << setprecision(20);
  solve();
  return 0;
}
const int N = (int)(1 * 1e4 + 10);
char used[N];
int ans[N];
void solve() {
  int n;
  cin >> n;
  if (n <= 2) {
    cout << "1\n1\n";
    return;
  }
  if (n == 3) {
    cout << "2\n1 3\n";
    return;
  }
  int k = 0;
  for (int i = (n & 1) ? n : n - 1; i >= 1; i -= 2) {
    ans[k++] = i;
  }
  for (int i = (n & 1) ? n - 1 : n; i >= 2; i -= 2) {
    ans[k++] = i;
  }
  cout << k << "\n";
  for (auto i = 0; i < k; ++i) {
    cout << ans[i] << ' ';
  }
  cout << "\n";
}
