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