#include <bits/stdc++.h>
using namespace std;
const int inf = 1000000000;
long long mod = 1000000007LL;
long long mod2 = 998244353LL;
int n, m;
int main() {
  cin >> n;
  int ans = (n / 2) * (n - n / 2);
  printf("%d\n", ans);
  for (int i = 1; i <= n / 2; ++i) {
    for (int j = n / 2 + 1; j <= n; ++j) {
      printf("%d %d\n", i, j);
    }
  }
  return 0;
}
