#include <bits/stdc++.h>
using namespace std;
const int oo = (int)1e9;
const double PI = 2 * acos(0.0);
const double eps = 1e-9;
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  cout << (n / 2) * (n - n / 2) << endl;
  for (int i = 1; i < (int)(n / 2 + 1); i++) {
    for (int k = n / 2 + 1; k < (int)(n + 1); k++) {
      cout << i << " " << k << endl;
    }
  }
  return 0;
}
