#include <bits/stdc++.h>
using namespace std;
int n;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  if (n & 1)
    cout << (n / 2) * (n / 2 + 1);
  else
    cout << (n / 2) * (n / 2);
  cout << "\n";
  for (int i = 1; i <= n / 2; i++)
    for (int j = n / 2 + 1; j <= n; j++) cout << i << " " << j << "\n";
  return 0;
}
