#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  list<int> a, b;
  list<int>::iterator it, it2;
  scanf("%d", &n);
  int i, j, k, num = 0;
  for (i = 1; i <= n; i++) {
    for (j = 1; j < n; j += 2) {
      k = i + j;
      if (k > n) break;
      a.push_back(i);
      b.push_back(k);
      num++;
    }
  }
  printf("%d\n", num);
  it = a.begin();
  it2 = b.begin();
  for (i = 0; i < num; i++, it++, it2++) {
    printf("%d %d\n", *it, *it2);
  }
  return 0;
}
