#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int m = 3;
  while (m * (m + 1) / 2 <= n) ++m;
  cout << m << endl;
  int cnt = 1;
  vector<vector<int> > res(m);
  for (int i = 0; i < m; ++i) {
    for (int j = i + 1; j < m; ++j) {
      res[i].push_back(cnt);
      res[j].push_back(cnt);
      ++cnt;
    }
  }
  for (int i = 0; i < m; ++i) {
    for (int j = 0; j < (int)(res[i]).size(); ++j) {
      cout << res[i][j] << " ";
    }
    cout << endl;
  }
}
