#include <bits/stdc++.h>
using namespace std;
const int SIZE = 200;
int A[SIZE][SIZE];
int main() {
  int N, k = 3, i = 2;
  cin >> N;
  A[1][++A[1][0]] = 1;
  A[2][++A[2][0]] = 1;
  N -= 1;
  while (true) {
    if (N < k - 1) break;
    for (int j = 1; j != k; j++, i++) A[j][++A[j][0]] = i, A[k][++A[k][0]] = i;
    N -= (k - 1);
    k++;
  }
  k--;
  cout << k << endl;
  for (int i = 1; i != k + 1; i++, (cout << endl))
    for (int j = 1; j != A[i][0] + 1; j++) cout << A[i][j] << ' ';
  return 0;
}
