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