#include <bits/stdc++.h>
using namespace std;
const int N = 109;
vector<int> L[N];
int dp[N];
int v[N];
void init() {
  dp[1] = 0;
  dp[2] = 1;
  dp[3] = 2;
  L[2].push_back(1);
  L[3].push_back(2);
  for (int i = 4; i < 101; i++) {
    memset(v, 0, sizeof(v));
    L[i].push_back(i - 1);
    for (int j = 0; j < (int)L[i - 1].size(); j++) v[L[i - 1][j]] = 1;
    dp[i]++;
    for (int j = 1; j < i - 1; j++)
      if (!v[j]) {
        L[i].push_back(j);
        dp[i]++;
      }
    dp[i] += dp[i - 1];
  }
}
int main() {
  init();
  int n;
  scanf("%d", &n);
  printf("%d\n", dp[n]);
  for (int i = 2; i <= n; i++) {
    for (int j = 0; j < (int)L[i].size(); j++) {
      printf("%d %d\n", i, L[i][j]);
    }
  }
  return 0;
}
