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