#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> lf, rg;
  for (int i = 1; i <= n; i++) {
    if (i <= n / 2)
      lf.push_back(i);
    else
      rg.push_back(i);
  }
  cout << lf.size() * rg.size() << endl;
  for (int i : lf) {
    for (int j : rg) {
      cout << i << " " << j << endl;
    }
  }
  return 0;
}
