#include <bits/stdc++.h>
int n, i, j, k, ans, a, b;
using namespace std;
int main() {
  cin >> n;
  a = n / 2;
  b = n - a;
  cout << a * b << "\n";
  for (i = 1; i <= a; i++) {
    for (j = a + 1; j <= b + a; j++) {
      cout << i << " " << j << "\n";
    }
  }
}
