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