#include <bits/stdc++.h>
using namespace std;
long long int n;
int main() {
  long long int i, j;
  cin >> n;
  if (n % 4 == 0) {
    cout << 0 << endl << n / 2 << " ";
    for (int i = 1; i <= n / 2; i += 2) {
      cout << i << " " << n - i + 1 << " ";
    }
  } else if (((n - 3) / 2) % 2 == 0) {
    if (n == 2)
      cout << 1 << endl;
    else
      cout << 0 << endl;
    cout << n / 2 << " ";
    for (int i = 2; i <= n / 2; i += 2) {
      cout << i << " " << n - i << " ";
    }
    cout << n << endl;
  } else if ((n / 2) % 2 == 1) {
    cout << 1 << endl << n / 2 << " ";
    for (int i = 1; i < n / 2; i += 2) {
      cout << i << " " << n - i + 1 << " ";
    }
    cout << n / 2;
  } else {
    cout << 1 << endl << n / 2 << " ";
    for (int i = 2; i <= n / 2; i += 2) {
      cout << i << " " << n + 2 - i << " ";
    }
  }
  return 0;
}
