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