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