#include <bits/stdc++.h>
using namespace std;
vector<int> G[100005];
int find(int v, int* parent) {
  if (parent[v] == v) {
    return v;
  }
  return find(parent[v], parent);
}
int vis[100005];
int main() {
  int n;
  cin >> n;
  if (n == 2) {
    cout << "1" << endl
         << "1"
         << " "
         << "1";
    return 0;
  }
  int ans;
  if (n % 2 == 0)
    ans = 0;
  else
    ans = (n + 1) / 2;
  if (n % 2 == 0) {
    if ((n / 2) % 2 == 0) {
      cout << ans << endl << (n + 1) / 2 << " ";
      int i, j;
      for (i = 1, j = n; i < j; i += 2, j -= 2) cout << i << " " << j << " ";
      if (i == j) cout << i;
    } else {
      cout << "1" << endl << n / 2 << " ";
      int i, j;
      for (i = 1, j = n; i + 1 != j; i += 2, j -= 2)
        cout << i << " " << j << " ";
      cout << i << " ";
    }
  } else {
    if (((n - 1) / 2) % 2 == 0) {
      cout << "1" << endl << (n + 1) / 2 << " ";
      int i, j;
      for (i = 2, j = n; i < j; i += 2, j -= 2) cout << i << " " << j << " ";
      cout << 1;
    } else {
      cout << "0" << endl << n / 2 + 1 << " ";
      int i, j;
      for (i = 2, j = n; i + 1 != j; i += 2, j -= 2)
        cout << i << " " << j << " ";
      cout << i << " " << 1;
    }
  }
  return 0;
}
