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