#include <bits/stdc++.h>
using namespace std;
template <class T>
inline T gcd(T a, T b) {
  return b ? gcd(b, a % b) : a;
}
int main() {
  int n, i, k, j, m;
  scanf("%d", &n);
  int temp = 0;
  k = 1;
  while (temp <= n) {
    k++;
    temp = (k * (k - 1)) / 2;
  }
  k--;
  vector<int> a[200];
  m = 1;
  for (i = 0; i < k; i++) {
    for (j = i + 1; j < k; j++) {
      a[i].push_back(m);
      a[j].push_back(m);
      m++;
    }
  }
  printf("%d\n", k);
  for (int i = (int)0; i < (int)k; ++i) {
    int len = int((a[i]).size());
    for (int j = (int)0; j < (int)len; ++j) printf("%d ", a[i][j]);
    printf("\n");
  }
  return 0;
}
