#include <bits/stdc++.h>
using namespace std;
int n;
int main() {
  scanf("%d", &n);
  int m = 3;
  while (m * (m + 1) / 2 <= n) m++;
  vector<vector<int> > v;
  v.resize(m);
  int now = 0;
  for (int i = 0; i < m; i++)
    for (int j = i + 1; j < m; j++) {
      now++;
      v[i].push_back(now);
      v[j].push_back(now);
    }
  printf("%d\n", m);
  for (int i = 0; i < m; i++) {
    for (int j = 0; j < v[i].size(); j++) printf("%d ", v[i][j]);
    printf("\n");
  }
}
