#include <bits/stdc++.h>
using namespace std;
const int N = 400;
int ans[N][N];
int n;
int k;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  k = 3;
  while (k * (k + 1) / 2 <= n) k++;
  n = 1;
  for (int i = 1; i <= k; i++) {
    for (int j = i + 1; j <= k; j++) {
      ans[i][0]++;
      ans[j][0]++;
      ans[i][ans[i][0]] = n;
      ans[j][ans[j][0]] = n++;
    }
  }
  cout << k << endl;
  for (int i = 1; i <= k; i++) {
    for (int j = 1; j <= ans[i][0]; j++) cout << ans[i][j] << " ";
    cout << endl;
  }
}
