#include <bits/stdc++.h>
using namespace std;
void Weapons19() {
  cout << fixed << setprecision(16);
  cin.sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
}
int32_t main() {
  Weapons19();
  long long int n;
  cin >> n;
  long long int a = n / 2;
  long long int b = (n + 1) / 2;
  cout << a * b << "\n";
  for (long long int i = 0; i < n / 2; i++) {
    for (long long int j = n / 2; j < n; j++) {
      cout << i + 1 << " " << j + 1 << "\n";
    }
  }
}
