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