#include <bits/stdc++.h>
int main(void) {
  int n;
  scanf("%d", &n);
  int a = n / 2;
  int b = (n + 1) / 2;
  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;
}
