#include <bits/stdc++.h>
using namespace std;
vector<long long> a;
long long N, n, sum = 0;
int main() {
  cin >> N;
  n = N;
  while (n > 0) {
    a.push_back(n--);
    sum += a[a.size() - 1];
    n -= 2;
    if (n > 0) {
      a.push_back(n--);
      sum += a[a.size() - 1];
    }
  };
  cout << abs(2 * sum - ((N * (N + 1)) / 2)) << endl;
  cout << a.size() << " ";
  for (int i = 0; i < a.size(); i++) {
    cout << a[i] << " ";
  }
  return 0;
}
