#include <bits/stdc++.h>
using namespace std;
int main() {
  int a;
  cin >> a;
  int m;
  if (a % 2 == 1) {
    m = (a / 2) * (a / 2 + 1);
  } else {
    m = (a / 2) * (a / 2);
  }
  cout << m << endl;
  for (int i = 1; i <= a / 2; i++) {
    for (int j = a / 2 + 1; j <= a; j++) {
      cout << i << " " << j << endl;
    }
  }
  return 0;
}
