#include <bits/stdc++.h>
using namespace std;
int a[2000005];
int main() {
  int n, i;
  cin >> n;
  if (n % 2 == 0) {
    int k = n / 2;
    if (k % 2 == 0) {
      cout << "0\n";
      cout << n / 2 << " ";
      for (i = 0; i < n / 2; i += 2) cout << i + 1 << " " << n - i << " ";
    } else {
      cout << "1\n";
      cout << n / 2 << " ";
      for (i = 0; i < n / 2 - 1; i += 2) cout << i + 1 << " " << n - i << " ";
      cout << n / 2;
    }
    return 0;
  } else {
    int k = n / 4, l = n % 4;
    if (l == 1 || l == 2)
      cout << "1\n";
    else
      cout << "0\n";
    cout << (2 * k) + l / 2 << " ";
    for (i = 0; i < k; i++) cout << n - 4 * i << " " << n - 4 * i - 3 << " ";
    if (l == 2)
      cout << "1";
    else if (l == 3)
      cout << "3";
  }
  return 0;
}
