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