#include <bits/stdc++.h>
using namespace std;
using pii = pair<int, int>;
int n;
vector<int> a[200];
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout << fixed;
  cin >> n;
  int k = (1 + sqrt(1 + 8 * n)) / 2, x = 1;
  cout << k << endl;
  for (int i = 1; i <= k; i++) {
    for (int j = i + 1; j <= k; j++) {
      a[i].push_back(x);
      a[j].push_back(x);
      x++;
    }
  }
  for (int i = 1; i <= k; i++) {
    int m = a[i].size();
    for (int j = 0; j < m; j++) {
      cout << a[i][j] << (j == m - 1 ? '\n' : ' ');
    }
  }
  return 0;
}
