#include <bits/stdc++.h>
using namespace std;
long long ckfun(long long n) {
  if (n < 100) return n;
  if (n % 10 != 0) return ckfun(n / 10);
  return ckfun(n / 10);
}
long long fun(long long n) {
  long long res = 1;
  for (long long i = 2; i <= n; i++) {
    res = i * res;
    res = ckfun(res);
    cout << i << " " << res << endl;
  }
  return res;
}
int32_t main() {
  ;
  ios_base::sync_with_stdio(false);
  ;
  long long t, n, m;
  cin >> n;
  vector<long long> arr, a;
  for (long long i = 1; i <= n; i++) arr.push_back(i);
  long long j = n % 4;
  for (long long i = j + 1; i < n; i += 4) {
    a.push_back(arr[i]);
    a.push_back(arr[i + 1]);
  }
  long long diff = 0;
  if (n % 4 == 1) diff = 1;
  if (n % 4 == 2) {
    diff = 1;
    a.push_back(1);
  }
  if (n % 4 == 3) {
    a.push_back(3);
  }
  cout << diff << endl;
  cout << a.size() << " ";
  for (auto x : a) cout << x << " ";
}
