#include <bits/stdc++.h>
using namespace std;
struct M {
  int t, x[4];
  M(int s, int a, int b, int c, int d = 0) {
    t = s;
    x[0] = a;
    x[1] = b;
    x[2] = c;
    x[3] = d;
  }
  void p() {
    printf("%d", t);
    for (int i = 0; i < (int)(t); ++i) printf(" %d", x[i]);
    printf("\n");
  }
};
vector<M> an;
int main() {
  int n;
  scanf("%d", &n);
  while (n > 4) {
    int a = n, b = n - 1;
    an.push_back(M(3, 1, a, b));
    an.push_back(M(3, 1, a, b));
    for (int i = 3; i < (int)(b); ++i) an.push_back(M(4, i - 1, a, i, b));
    an.push_back(M(4, b - 1, a, 2, b));
    n -= 2;
  }
  if (n == 4) {
    an.push_back(M(4, 1, 2, 3, 4));
    an.push_back(M(4, 1, 3, 4, 2));
    an.push_back(M(4, 1, 4, 2, 3));
  } else {
    an.push_back(M(3, 1, 2, 3));
    an.push_back(M(3, 1, 2, 3));
  }
  printf("%d\n", (int)an.size());
  for (int i = 0; i < (int)(an.size()); ++i) an[i].p();
}
