#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const long long inf64 = 0x3f3f3f3f3f3f3f3fLL;
const long double pi = 3.14159265358979;
const long double eps = 1e-7;
int main() {
  int n;
  cin >> n;
  vector<pair<int, int> > res;
  for (int i = 1; i <= n; i++)
    for (int j = i - 1; j >= 1; j -= 2) res.push_back(pair<int, int>(i, j));
  printf("%d\n", res.size());
  for (int i = 0; i < res.size(); i++)
    printf("%d %d\n", res[i].first, res[i].second);
  return 0;
}
