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