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