#include <bits/stdc++.h>
int a[210][210];
int main() {
  int n, N, i, j, p;
  while (scanf("%d", &n) == 1) {
    for (N = 2;;) {
      if ((N + 1) * (N + 2) / 2 > n)
        break;
      else
        N++;
    }
    p = 1;
    for (i = 0; i < N; i++)
      for (j = i; j < N; j++) a[i][j] = p++;
    p = 1;
    for (j = 0; j < N; j++)
      for (i = j + 1; i <= N; i++) a[i][j] = p++;
    printf("%d\n", N + 1);
    for (i = 0; i <= N; i++) {
      for (j = 0; j < N; j++) {
        if (j) printf(" ");
        printf("%d", a[i][j]);
      }
      printf("\n");
    }
  }
  return 0;
}
