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