#include <bits/stdc++.h>
using namespace std;
char mov_y[] = {1, -1, 0, 0};
char mov_x[] = {0, 0, 1, -1};
vector<pair<long long, long long> > ve;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout << fixed << setprecision(6);
  long long n, i, j;
  cin >> n;
  for (i = 1; i <= n / 2; i++) {
    for (j = n / 2 + 1; j <= n; j++) ve.push_back(make_pair(i, j));
  }
  cout << ve.size() << endl;
  for (i = 0; i < ve.size(); i++)
    cout << ve[i].first << " " << ve[i].second << endl;
  return 0;
}
