#include <bits/stdc++.h>
int n;
std::vector<std::vector<int>> ans;
void out(int x, int y, int z) { ans.emplace_back(std::vector<int>({x, y, z})); }
void out(int x, int y, int z, int w) {
  ans.emplace_back(std::vector<int>({x, y, z, w}));
}
int main() {
  std::ios::sync_with_stdio(0), std::cin.tie(0);
  std::cin >> n;
  if (n & 1) {
    for (int i = 2; i < n; i += 2)
      for (int j = i + 2; j < n; j += 2)
        out(i, j + 1, i + 1, j), out(i, j + 1, i + 1, j);
    for (int i = 2; i < n; i += 2) out(1, i, i + 1), out(1, i, i + 1);
  } else {
    for (int i = 3; i < n; i += 2)
      for (int j = i + 2; j < n; j += 2)
        out(i, j + 1, i + 1, j), out(i, j + 1, i + 1, j);
    out(1, 2, 4, 3);
    out(1, 2, 3, 4);
    out(1, 3, 2, 4);
    for (int i = 5; i < n; i += 2)
      out(1, i, i + 1), out(2, i, i + 1), out(1, i, 2, i + 1);
  }
  std::cout << ans.size() << '\n';
  for (auto c : ans) {
    std::cout << c.size();
    for (int p : c) std::cout << ' ' << p;
    std::cout << '\n';
  }
  return 0;
}
