#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  int n;
  cin >> n;
  int r = n;
  if (n == 3) {
    cout << 0 << endl;
    cout << 1 << ' ' << 3;
    return 0;
  }
  if (n & 1) {
    vector<int> x, y;
    int a = 0, b = 0;
    for (int i = 2; i <= n / 2; ++i) {
      if (i & 1)
        a += i + n - i + 2, x.push_back(i), x.push_back(n - i + 2);
      else
        b += i + n - i + 2, y.push_back(i), y.push_back(n - i + 2);
    }
    if (a < b)
      a++, x.push_back(1);
    else
      b++, y.push_back(1);
    if (a < b)
      a += ceil(1.0 * n / 2) + 1, x.push_back(ceil(1.0 * n / 2) + 1);
    else
      b += ceil(1.0 * n / 2) + 1, y.push_back(ceil(1.0 * n / 2) + 1);
    if (a > b)
      b += ceil(1.0 * n / 2), y.push_back(ceil(1.0 * n / 2));
    else
      a += ceil(1.0 * n / 2), x.push_back(ceil(1.0 * n / 2));
    cout << abs(a - b) << endl;
    cout << x.size() << ' ';
    for (int i = 0; i < x.size(); ++i) cout << x[i] << ' ';
  } else {
    vector<int> x, y;
    int a = 0, b = 0;
    for (int i = 1; i < n / 2; ++i) {
      if (i & 1)
        a += i + n - i + 1, x.push_back(i), x.push_back(n - i + 1);
      else
        b += i + n - i + 1, y.push_back(i), y.push_back(n - i + 1);
    }
    if (a < b)
      a += ceil(n / 2) + 1, x.push_back(ceil(n / 2) + 1);
    else
      b += ceil(n / 2) + 1, y.push_back(ceil(n / 2) + 1);
    if (a > b)
      b += ceil(n / 2), y.push_back(ceil(n / 2));
    else
      a += ceil(n / 2), x.push_back(ceil(n / 2));
    cout << abs(a - b) << endl;
    cout << x.size() << ' ';
    for (int i = 0; i < x.size(); ++i) cout << x[i] << ' ';
  }
  return 0;
}
