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