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