#include <bits/stdc++.h>
using namespace std;
int v[205][205];
int main(void) {
  int n;
  scanf("%d", &n);
  for (int k = n; k >= 1; k--) {
    if (k * (k - 1) / 2 <= n) {
      printf("%d\n", k);
      int c = 0;
      for (int i = 1; i <= k; i++)
        for (int j = i + 1; j <= k; j++) v[i][j] = v[j][i] = ++c;
      for (int i = 1; i <= k; i++, puts(""))
        for (int j = 1; j <= k; j++)
          if (i == j)
            continue;
          else
            printf("%d ", v[i][j]);
      return 0;
    }
  }
  return 0;
}
