#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  scanf("%d", &N);
  vector<vector<int>> ans;
  if (N & 1) {
    ans.push_back({1, 2, 3});
    ans.push_back({1, 2, 3});
    for (int i = 4; i <= N; i += 2) {
      ans.push_back({i, i + 1, 1});
      ans.push_back({i, i + 1, 1});
      for (int j = 2; j < i; j += 2) {
        ans.push_back({j, i, j + 1, i + 1});
        ans.push_back({j, i, j + 1, i + 1});
      }
    }
  } else {
    ans.push_back({1, 2, 3});
    ans.push_back({2, 3, 4});
    ans.push_back({3, 4, 1});
    ans.push_back({4, 1, 2});
    for (int i = 5; i <= N; i += 2) {
      ans.push_back({1, i, i + 1});
      ans.push_back({2, i, i + 1});
      ans.push_back({1, i, 2, i + 1});
      for (int j = 3; j < i; j += 2) {
        ans.push_back({i, j, i + 1, j + 1});
        ans.push_back({i, j, i + 1, j + 1});
      }
    }
  }
  printf("%d\n", ans.size());
  for (auto a : ans) {
    printf("%d ", a.size());
    for (auto b : a) printf("%d ", b);
    printf("\n");
  }
}
