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