#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const int MAXN = 1e5 + 100;
void solve() {
  int n;
  cin >> n;
  if (n % 2 == 0)
    cout << n / 2 * n / 2 << endl;
  else
    cout << n / 2 * (n + 1) / 2 << endl;
  for (int i = 1; i < n / 2 + 1; i++)
    for (int j = n / 2 + 1; j < n + 1; j++) cout << i << " " << j << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int t = 1;
  while (t--) {
    solve();
  }
  cerr << "\nTime elapsed: " << 1000 * clock() / CLOCKS_PER_SEC << "ms\n";
  return 0;
}
