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