#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  cout << (n % 4 == 1 || n % 4 == 2) << endl;
  cout << n / 4 * 2 + (n % 4 == 0 ? 0 : 1) << ' ';
  while (n > 0) {
    cout << n << ' ';
    if (n > 3) cout << n - 3 << ' ';
    n -= 4;
  }
  return 0;
}
