#include <bits/stdc++.h>
using namespace std;
const long long MAX_N = 10 * 100 + 19;
const long long inf = 2e9 + 19;
long long n;
int32_t main() {
  ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  cin >> n;
  cout << 1ll * ((n + 1) / 2) * (n / 2) << endl;
  for (long long i = 1; i <= n; i++)
    for (long long j = i + 1; j <= n; j++)
      if ((i & 1) != (j & 1)) cout << i << ' ' << j << endl;
  return (0);
}
