#include <bits/stdc++.h>
using namespace std;
vector<vector<int> > r;
int main() {
  int n;
  scanf("%d", &n);
  for (int i = n - 1; i >= 4; i -= 2) {
    r.push_back({i - 2, i - 1, i});
    r.push_back({i - 2, i - 1, i});
    for (int j = 0, ThxDem = i - 2; j < ThxDem; ++j)
      r.push_back({i, j, i - 1, (j + 1) % (i - 2)});
  }
  if (n % 2)
    r.push_back({0, 1, 2}), r.push_back({0, 1, 2});
  else
    r.push_back({0, 1, 2}), r.push_back({1, 2, 3}), r.push_back({2, 3, 0}),
        r.push_back({3, 0, 1});
  printf("%d\n", (int)r.size());
  for (auto v : r) {
    printf("%d", (int)v.size());
    for (int x : v) printf(" %d", x + 1);
    puts("");
  }
  return 0;
}
