#include <bits/stdc++.h>
using namespace std;
int main() {
  int h;
  cin >> h;
  int x = (int)(0.5 + sqrt(1.0 + 8 * h) / 2.0);
  cout << x << endl;
  vector<int> s[x];
  int a = 1;
  for (int i = 0; i < x - 1; i++) {
    for (int j = i + 1; j < x; j++) {
      s[i].push_back(a);
      s[j].push_back(a);
      a++;
    }
  }
  for (int tag = 0; tag < x; tag++) {
    cout << s[tag][0];
    for (int i = 1; i < s[tag].size(); i++) cout << " " << s[tag][i];
    cout << endl;
  }
  return 0;
}
