#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m1, i, j, m2;
  cin >> n;
  m1 = n % 4;
  m2 = n / 4;
  if ((m1 == 3) || (m1 == 0))
    cout << 0 << endl;
  else if ((m1 == 1) || (m1 == 2))
    cout << 1 << endl;
  cout << n / 2 << " ";
  if (m2 > 0) {
    for (j = 1; j <= m2; j++) {
      i = j * 4 + m1;
      cout << i << " " << i - 3 << " ";
    }
    if (m1 == 3)
      cout << 3 << " ";
    else if (m1 == 2)
      cout << 2 << " ";
  } else if (m2 == 0) {
    if (n == 3)
      cout << 3 << " ";
    else if (n == 2)
      cout << 2 << " ";
  }
}
