#include <bits/stdc++.h>
#pragma GCC optimize("Ofast,inline,unroll-loops,fast-math")
#pragma GCC optimize("O3")
using namespace std;
using namespace std::chrono;
long long mod_exp(long long x, long long n) {
  long long res = 1;
  while (n > 0) {
    if (n & 1) res = (res * x) % 1000000007;
    x = (x * x) % 1000000007;
    n >>= 1;
  }
  return res;
}
void inout() {
  freopen("in.txt", "r", stdin);
  freopen("out.txt", "w", stdout);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long n, i, j;
  cin >> n;
  cout << n * (n + 1) / 2 % 2 << endl << n / 2 << " ";
  j = 0;
  for (i = n; i > 1; i -= 2) {
    cout << i - j << " ";
    j = !j;
  }
  return 0;
}
