#include <bits/stdc++.h>
using namespace std;
struct node {
  int x, y, z;
  node(int _x, int _y, int _z) {
    x = _x;
    y = _y;
    z = _z;
  }
};
struct Node {
  int x, y, z, k;
  Node(int _x, int _y, int _z, int _k) {
    x = _x;
    y = _y;
    z = _z;
    k = _k;
  }
};
vector<node> ans3;
vector<Node> ans4;
vector<int> F[10000];
int cnt;
void work(vector<int>& G) {
  int m = G.size();
  if (m == 3) {
    ans3.push_back(node(G[0], G[1], G[2]));
    ans3.push_back(node(G[0], G[1], G[2]));
  } else if (m == 4) {
    ans3.push_back(node(G[0], G[1], G[2]));
    ans3.push_back(node(G[1], G[2], G[3]));
    ans3.push_back(node(G[2], G[3], G[0]));
    ans3.push_back(node(G[3], G[0], G[1]));
  } else if (m == 5) {
    ans3.push_back(node(G[4], G[3], G[1]));
    ans3.push_back(node(G[2], G[0], G[4]));
    ans4.push_back(Node(G[3], G[4], G[1], G[2]));
    ans4.push_back(Node(G[3], G[2], G[1], G[0]));
    ans3.push_back(node(G[3], G[1], G[0]));
    ans3.push_back(node(G[2], G[0], G[4]));
  } else if (m == 6) {
    ans4.push_back(Node(G[0], G[1], G[3], G[4]));
    ans4.push_back(Node(G[1], G[2], G[4], G[5]));
    ans4.push_back(Node(G[2], G[3], G[5], G[0]));
    ans3.push_back(node(G[0], G[2], G[3]));
    ans3.push_back(node(G[1], G[3], G[4]));
    ans3.push_back(node(G[2], G[4], G[5]));
    ans3.push_back(node(G[3], G[5], G[0]));
    ans3.push_back(node(G[4], G[0], G[1]));
    ans3.push_back(node(G[5], G[1], G[2]));
  } else {
    if (m & 1) {
      ++cnt;
      for (int i = 0; i < G.size(); i += 2) F[cnt].push_back(G[i]);
      ++cnt;
      for (int i = 1; i < G.size(); i += 2) F[cnt].push_back(G[i]);
      for (int i = 0; i < F[cnt].size(); ++i) {
        for (int j = 0; j < F[cnt - 1].size(); ++j)
          ans3.push_back(node(F[cnt][i], F[cnt - 1][j],
                              F[cnt - 1][(j + i + 1) % (F[cnt - 1].size())]));
      }
      work(F[cnt]);
    } else {
      ++cnt;
      for (int i = 0; i < 4; ++i) F[cnt].push_back(G[i]);
      ++cnt;
      for (int i = 4; i < G.size(); ++i) F[cnt].push_back(G[i]);
      for (int i = 0; i < F[cnt - 1].size(); i += 2) {
        for (int j = 0; j < F[cnt].size(); j += 2) {
          ans4.push_back(
              Node(F[cnt - 1][i], F[cnt][j], F[cnt - 1][i + 1], F[cnt][j + 1]));
          ans4.push_back(
              Node(F[cnt - 1][i], F[cnt][j], F[cnt - 1][i + 1], F[cnt][j + 1]));
        }
      }
      work(F[cnt - 1]);
      work(F[cnt]);
    }
  }
}
int main() {
  int n;
  scanf("%d", &n);
  cnt = 0;
  for (int i = 1; i <= n; ++i) F[0].push_back(i);
  work(F[0]);
  printf("%d\n", ans3.size() + ans4.size());
  for (int i = 0; i < ans3.size(); ++i)
    printf("3 %d %d %d\n", ans3[i].x, ans3[i].y, ans3[i].z);
  for (int i = 0; i < ans4.size(); ++i)
    printf("4 %d %d %d %d\n", ans4[i].x, ans4[i].y, ans4[i].z, ans4[i].k);
  return 0;
}
