#include <bits/stdc++.h>
using namespace std;
vector<int> adj[500000];
bool visited[500000];
int main() {
  long long n;
  cin >> n;
  long long k = n * (n + 1);
  k /= 2;
  cout << k % 2 << endl;
  k /= 2;
  cout << n / 2 << " ";
  int j = 0;
  for (long long i = n; i > 1; i = i - 2) {
    cout << i - j << " ";
    j = !j;
  }
}
