#include <bits/stdc++.h>
using namespace std;
vector<vector<int> > ans;
int n;
void solve(int n) {
  if (n == 3) {
    ans.emplace_back(vector<int>{1, 2, 3});
    ans.emplace_back(vector<int>{1, 2, 3});
    return;
  }
  if (n == 4) {
    ans.emplace_back(vector<int>{1, 2, 3});
    ans.emplace_back(vector<int>{1, 2, 4});
    ans.emplace_back(vector<int>{1, 3, 4});
    ans.emplace_back(vector<int>{2, 3, 4});
    return;
  }
  for (int i = 1; i <= n - 3; ++i)
    ans.emplace_back(vector<int>{i, n - 1, i + 1, n});
  ans.emplace_back(vector<int>{1, n - 1, n});
  ans.emplace_back(vector<int>{n - 2, n - 1, n});
  solve(n - 2);
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  solve(n);
  cout << ans.size() << '\n';
  for (auto i : ans) {
    cout << i.size();
    for (int j : i) cout << ' ' << j;
    cout << '\n';
  }
  return 0;
}
