#include <bits/stdc++.h>
using namespace std;
int i, n, x, y;
int a[1000000];
int main() {
  scanf("%d", &n);
  int b = 0;
  if (n % 2 == 1) {
    n--;
    b = 1;
    for (int i = 1; i <= n; i++) a[i] = i + 1;
  } else {
    for (int i = 1; i <= n; i++) a[i] = i;
  }
  int n1 = n / 2;
  int ans;
  if (b && n1 % 2 == 1) ans = 0;
  if (b && n1 % 2 == 0) ans = 1;
  if (b == 0 && n1 % 2 == 0) ans = 0;
  if (b == 0 && n1 % 2 == 1) ans = 1;
  printf("%d\n", ans);
  printf("%d ", n1 + b);
  if (b) printf("1 ");
  int x = 1;
  if (n1 % 2 == 1) {
    printf("%d ", a[n1]);
    n1--;
  }
  for (int i = 1; i <= n1; i++) {
    if (x == 1) {
      printf("%d %d ", a[i], a[n - i + 1]);
    }
    x = (x + 1) % 2;
  }
  return 0;
}
