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