#include <bits/stdc++.h>
using namespace std;
bool a[109][109];
int main() {
  int n;
  int cnt = 0;
  scanf("%d", &n);
  for (int i = 1; i < n; i++) {
    cnt++;
    a[i][i + 1] = a[i + 1][i] = 1;
  }
  for (int i = 1; i <= n; i++)
    for (int j = i + 3; j <= n; j += 2) {
      cnt++;
      a[i][j] = a[j][i] = 1;
    }
  printf("%d\n", cnt);
  for (int i = 1; i <= n; i++)
    for (int j = i + 1; j <= n; j++)
      if (a[i][j]) printf("%d %d\n", i, j);
}
