#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, sz;
  cin >> n;
  if (n & 1) {
    sz = n / 2 + 1;
    cout << (sz - 1) * sz << "\n";
  } else {
    sz = n / 2;
    cout << sz * sz << "\n";
  }
  for (int i = 1; i <= sz; i++)
    for (int j = sz + 1; j <= n; j++) cout << i << " " << j << "\n";
  return 0;
}
