#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e8;
const double EPS = 1e-6;
const long long MOD = (long long)(1e5);
const long long MAXV = (long long)(2e3 + 10);
const long long MAXE = (long long)(4e5 + 10);
int n;
vector<pair<int, int> > sol;
int main() {
  scanf("%d", &n);
  int b = n / 2;
  int a = n - b;
  for (int i = 1; i <= a; i++) {
    for (int j = 1; j <= b; j++) {
      sol.push_back(pair<int, int>(i, j + a));
    }
  }
  printf("%d\n", a * b);
  for (int i = 0; i < sol.size(); i++) {
    printf("%d %d\n", sol[i].first, sol[i].second);
  }
  return 0;
}
