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