#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  while (cin >> n) {
    int m = n % 4;
    cout << (m == 0 || m == 3 ? 0 : 1) << endl << n / 2 << ' ';
    for (int i = n; i >= 4; i -= 4) cout << i - 1 << ' ' << i - 2 << ' ';
    if (m == 2)
      cout << "1 " << endl;
    else if (m == 3)
      cout << "3 " << endl;
    else
      cout << endl;
  }
  return 0;
}
