#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  if (n % 2) {
    int y = n / 2;
    cout << y * (y + 1) << endl;
  } else {
    int y = n / 2;
    cout << y * y << endl;
  }
  while (n > 4) {
    int a = n;
    int b = n - 1;
    n -= 2;
    if (n % 2) {
      cout << "3 1 " << a << ' ' << b << endl;
      cout << "3 1 " << a << ' ' << b << endl;
      for (int i = 2; i <= n; i += 2) {
        cout << "4 " << i << ' ' << a << ' ' << i + 1 << ' ' << b << endl;
        cout << "4 " << i << ' ' << a << ' ' << i + 1 << ' ' << b << endl;
      }
    } else {
      cout << "3 1 " << a << ' ' << b << endl;
      cout << "3 2 " << a << ' ' << b << endl;
      cout << "4 1 " << a << ' ' << "2" << ' ' << b << endl;
      for (int i = 3; i <= n; i += 2) {
        cout << "4 " << i << ' ' << a << ' ' << i + 1 << ' ' << b << endl;
        cout << "4 " << i << ' ' << a << ' ' << i + 1 << ' ' << b << endl;
      }
    }
  }
  if (n % 2) {
    cout << "3 1 2 3" << endl;
    cout << "3 1 2 3" << endl;
  } else {
    cout << "3 1 2 3" << endl;
    cout << "3 1 2 4" << endl;
    cout << "3 1 3 4" << endl;
    cout << "3 2 3 4" << endl;
  }
  return 0;
}
