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