#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n;
  scanf("%lld", &n);
  vector<long long int> a;
  if (n % 4 == 0) {
    for (long long int i = 1; i <= n; ++i) {
      if (i % 4 == 0 || i % 4 == 1) {
        a.push_back(i);
      }
    }
    cout << 0 << "\n";
  } else if (n % 4 == 1) {
    for (long long int i = 1; i <= (n / 4 + 1); ++i) {
      a.push_back(i);
    }
    for (long long int i = (n - (n / 4) + 1); i <= n; i++) {
      a.push_back(i);
    }
    cout << 1 << "\n";
  } else if (n % 4 == 2) {
    for (long long int i = 1; i <= n; ++i) {
      if (i % 4 == 0 || i % 4 == 1) {
        a.push_back(i);
      }
    }
    cout << 1 << "\n";
  } else {
    for (long long int i = 1; i <= n / 4; ++i) {
      a.push_back(i);
    }
    for (long long int i = (n - n / 4); i <= n; i++) {
      a.push_back(i);
    }
    cout << 0 << "\n";
  }
  cout << a.size() << " ";
  for (long long int i = 0; i < a.size(); ++i) {
    cout << a[i] << " ";
  }
  return 0;
}
