#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10;
vector<pair<int, int> > v;
int n;
int main() {
  ios::sync_with_stdio(false);
  cin >> n;
  for (int i = 1; i < n; i++) v.push_back({i, i + 1});
  for (int i = 1; i <= n; i++) {
    for (int j = i + 3; j <= n; j += 2) {
      v.push_back({i, j});
    }
  }
  cout << v.size() << '\n';
  for (auto k : v) cout << k.first << ' ' << k.second << endl;
  return 0;
}
