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