#include <bits/stdc++.h>
using namespace std;
const int maxn = 100 + 4;
const int inf = 1e18;
const long long mod = 1e9 + 7;
vector<pair<int, int> > ans;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.precision(20);
  int n;
  cin >> n;
  for (int i = 1; i <= n / 2; i++)
    for (int j = n / 2 + 1; j <= n; j++) ans.push_back(make_pair(i, j));
  cout << ans.size() << endl;
  for (int i = 0; i < ans.size(); i++)
    cout << ans[i].first << " " << ans[i].second << endl;
  return 0;
}
