#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  long long n;
  cin >> n;
  cout << n * n / 4 << endl;
  for (int i = 2; i <= n / 2 + 1; i++) cout << 1 << ' ' << i << endl;
  for (int i = 2; i <= n / 2 + 1; i++)
    for (int j = n / 2 + 2; j <= n; j++) cout << i << ' ' << j << endl;
  return 0;
}
