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