#include <bits/stdc++.h>
using namespace std;
const int MAX = 100;
bool ady[MAX + 5][MAX + 5] = {0};
vector<pair<int, int> > ans;
int n;
int main() {
  cin >> n;
  for (int i = 0; i < n; ++i) {
    for (int j = i + 1; j < n; j += 2) {
      if (!ady[i][j]) {
        ans.push_back(make_pair(i, j));
        ady[i][j] = ady[j][i] = 1;
      }
    }
  }
  cout << (int)ans.size() << "\n";
  for (int i = 0; i < (int)ans.size(); ++i) {
    cout << ans[i].first + 1 << " " << ans[i].second + 1 << "\n";
  }
}
