#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, a, b;
  scanf("%d", &n);
  if (n == 2) {
    printf("1\n1 1\n");
    return 0;
  }
  if (n == 3) {
    printf("0\n1 3\n");
    return 0;
  }
  switch (n % 4) {
    case 0: {
      printf("0\n%d", n / 2);
      a = 1;
      b = n;
      m = n / 4;
      break;
    }
    case 1: {
      printf("1\n%d", 2 + (n - 5) / 2);
      a = 6;
      b = n;
      m = (n - 5) / 4;
      printf(" 3 4");
      break;
    }
    case 2: {
      printf("1\n%d", 1 + (n - 2) / 2);
      a = 3;
      b = n;
      m = (n - 2) / 4;
      printf(" 1");
      break;
    }
    case 3: {
      printf("0\n%d", 1 + (n - 3) / 2);
      a = 4;
      b = n;
      m = (n - 3) / 4;
      printf(" 3");
      break;
    }
  }
  for (int i = 0; i < m; ++i) printf(" %d %d", a++, b--);
  printf("\n");
  return 0;
}
