#include <bits/stdc++.h>
int n;
int main() {
  scanf("%d", &n);
  switch (n % 4) {
    case 0:
      printf("0\n%d ", n / 2);
      for (int i = 0; i < n / 4; i++) printf("%d %d ", 2 * i + 1, n - 2 * i);
      break;
    case 1:
      printf("1\n%d ", n / 2 + 1);
      for (int i = 0; i < n / 4; i++) printf("%d %d ", 2 * i + 2, n - 2 * i);
      printf("1");
      break;
    case 2:
      printf("1\n%d ", n / 2);
      for (int i = 0; i < n / 4; i++) printf("%d %d ", 2 * i + 1, n - 2 * i);
      printf("%d", n / 2);
      break;
    case 3:
      printf("0\n%d ", n / 2 + 1);
      for (int i = 0; i < n / 4; i++) printf("%d %d ", 2 * i + 2, n - 2 * i);
      printf("%d 1", n / 2 + 1);
  }
  return 0;
}
