#include <bits/stdc++.h>
using namespace std;
string filename = "test";
int main() {
  int n;
  cin >> n;
  if (n == 1) {
    cout << 0 << endl;
  } else {
    int n1 = n / 2;
    int n2 = n - n1;
    int m = n1 * n2;
    printf("%d\n", m);
    for (int _n(n2), i(0); i < _n; i++) {
      for (int _n(n1), j(0); j < _n; j++) {
        printf("%d %d\n", 2 * i + 1, 2 * j + 2);
      }
    }
  }
  return 0;
}
