#include <bits/stdc++.h>
using namespace std;
vector<int> out[1000];
int main() {
  int n;
  scanf("%d", &n);
  int ans;
  for (int i = 1; i * (i - 1) / 2 <= n; i++) {
    ans = i;
  }
  int id = 1;
  for (int i = 0; i < ans; i++) {
    for (int j = i + 1; j < ans; j++) {
      out[i].push_back(id);
      out[j].push_back(id);
      id++;
    }
  }
  printf("%d\n", ans);
  for (int i = 0; i < ans; i++, puts(""))
    for (int j = 0; j < out[i].size(); j++) printf("%d ", out[i][j]);
  return 0;
}
