#include <bits/stdc++.h>
using namespace std;
int ans[100005], cnt;
int main(int argc, char** argv) {
  int n;
  cin >> n;
  cout << (n % 4 == 1 || n % 4 == 2) << "\n";
  while (n >= 4) {
    ans[++cnt] = n;
    ans[++cnt] = n - 3;
    n -= 4;
  }
  if (n == 1 || n == 2) ans[++cnt] = 1;
  if (n == 3) ans[++cnt] = 3;
  cout << cnt << " ";
  for (int i = 1; i <= cnt; i++) cout << ans[i] << " ";
  return 0;
}
