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