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