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