#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  cout << ((N % 2) ? (N / 2) * ((N / 2) + 1) : (N * N) / 4) << endl;
  for (int i = 1; i <= N; i++) {
    for (int j = i; j <= N; j++) {
      if (i % 2) {
        if (j % 2 == 0) cout << i << " " << j << endl;
      } else {
        if (j % 2) cout << i << " " << j << endl;
      }
    }
  }
  return 0;
}
