#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<pair<int, int> > result;
  for (int i = 1; i <= n / 2; ++i)
    for (int j = n / 2 + 1; j <= n; ++j) result.push_back(pair<int, int>(i, j));
  cout << result.size() << endl;
  for (int i = 0; i < result.size(); i++)
    cout << result[i].first << " " << result[i].second << endl;
  return 0;
}
