#include <bits/stdc++.h>
using namespace std;
long long f[200];
int main() {
  int n;
  cin >> n;
  f[1] = 0;
  for (int i = 0; i < 101; i++) {
    f[i] = f[i - 1] + (i / 2);
  }
  cout << f[n] << endl;
  for (int i = 1; i <= n; i++) {
    int x = i - 1;
    while (x > 0) {
      cout << i << " " << x;
      x -= 2;
      cout << endl;
    }
  }
  return 0;
}
