#include <bits/stdc++.h>
using namespace std;
int A[1000];
vector<int> ret[1000];
int main() {
  for (int i = 1; i <= 200; i++) {
    A[i] = A[i - 1] + i;
  }
  int n;
  cin >> n;
  int pos = lower_bound(A, A + 200, n) - A;
  if (A[pos] <= n) {
    pos++;
  }
  printf("%d\n", pos);
  int cur = 0;
  for (int i = 1; i <= pos; i++) {
    for (int j = i + 1; j <= pos; j++) {
      cur++;
      ret[i].push_back(cur);
      ret[j].push_back(cur);
    }
  }
  for (int i = 1; i <= pos; i++) {
    for (int j = 0; j < ret[i].size(); j++) {
      printf("%d ", ret[i][j]);
    }
    printf("\n");
  }
}
