#include <bits/stdc++.h>
using namespace std;
const int Maxn = 100100;
const int INF = 0x7f7f7f7f;
const double eps = 1e-8;
const double pi = 3.1415926535897932384626433832795;
int main() {
  int n;
  ios::sync_with_stdio(0);
  cin >> n;
  cout << n * n / 4 << endl;
  for (int i = 1; i <= n / 2; i++)
    for (int j = n / 2 + 1; j <= n; j++) cout << i << " " << j << endl;
  return 0;
}
