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