#include <bits/stdc++.h>
using namespace std;
const int N = 1e6;
int a[N], f[N];
vector<int> v[2];
int main() {
  int n;
  cin >> n;
  int idx = 0, cnt = 1;
  for (int i = n; i >= 1; i--) {
    v[idx].push_back(i);
    cnt++;
    if (cnt == 2) {
      idx ^= 1;
      cnt = 0;
    }
  }
  long long int f1 = 0, f2 = 0;
  for (int i = 0; i < v[0].size(); i++) f1 += v[0][i];
  for (int i = 0; i < v[1].size(); i++) f2 += v[1][i];
  cout << abs(f1 - f2) << endl;
  ;
  cout << v[0].size() << " ";
  for (int i = 0; i < v[0].size(); i++) printf("%d ", v[0][i]);
  return 0;
}
