#include <bits/stdc++.h>
using namespace std;
vector<int> u, v;
int n;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) {
    for (int j = i + 1; j <= n; j += 2) {
      u.push_back(i);
      v.push_back(j);
    }
  }
  printf("%d\n", (int)u.size());
  for (int i = 0; i < u.size(); ++i) {
    printf("%d %d\n", u[i], v[i]);
  }
  return 0;
}
