#include <bits/stdc++.h>
using namespace std;
void sum(int *x, int *p, int n, int *r) {
  int s1 = 0;
  int s2 = 0;
  int size1 = 0;
  for (int i = 0; i < n; i++) {
    if (p[i] == 0) {
      s1 += x[i];
      size1++;
    } else
      s2 += x[i];
  }
  r[0] = s1;
  r[1] = s2;
  r[2] = size1;
}
void print_ar(int *x, int *p, int n) {
  for (int i = 0; i < n; i++) {
    if (!p[i]) printf("%d ", x[i]);
  }
  printf("\n");
}
int main() {
  int n;
  scanf("%d", &n);
  int x[n];
  int p[n];
  int s[3];
  int ww = 0;
  for (int i = 1; i <= n; i++) {
    x[i - 1] = i;
    p[i - 1] = ww;
    ww = (ww + 1) % 2;
  }
  int diff;
  sum(x, p, n, s);
  diff = s[0] - s[1];
  while (abs(diff) > 1) {
    if (diff > 0) {
      for (int i = 0; i < n; i++) {
        if (p[i] == 0) {
          p[i] = 1;
          break;
        }
      }
    } else if (diff < 0) {
      for (int i = 0; i < n; i++) {
        if (p[i] == 1) {
          p[i] = 0;
          break;
        }
      }
    }
    sum(x, p, n, s);
    diff = s[0] - s[1];
  }
  printf("%d\n", abs(diff));
  printf("%d ", s[2]);
  print_ar(x, p, n);
  return 0;
}
