#include <bits/stdc++.h>
using namespace std;
typedef struct {
  int sum, suf, pre, max;
} Node;
int toint(const string &s) {
  stringstream ss;
  ss << s;
  int x;
  ss >> x;
  return x;
}
const int N = 1e5 + 10;
const int MAXN = 3010;
const int UP = 31;
const int lim = 1e18 + 1;
const int mod = 1e9 + 7;
const long long int highest = 1e18;
const int inf = 1e9 + 10;
const double pi = acos(-1);
const double Phi = 1.618033988749894;
const int logn = 20;
const double phi = 0.618033988749894;
const double root5 = 2.236067977;
vector<int> pts;
vector<int> prs;
int main() {
  int n;
  scanf("%d", &n);
  int m = (n * n) / 4;
  for (int i = 1; i <= n; i += 2) {
    pts.push_back(i);
  }
  for (int i = 2; i <= n; i += 2) {
    prs.push_back(i);
  }
  cout << m << endl;
  int k = 0;
  bool f = 1;
  for (int i = 0; i < (int)pts.size() && f; ++i) {
    for (int j = 0; j < (int)prs.size(); ++j) {
      cout << pts[i] << " " << prs[j] << endl;
      ++k;
      if (k >= m) {
        f = 0;
        break;
      }
    }
  }
  return 0;
}
