#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int t;
  t = n / 2;
  int c = 0;
  cout << t + 1 << endl;
  for (int i = 1; i <= t + 1; i++) {
    for (int j = 1; j <= t + 1; j++) {
      cout << i << " " << j << endl;
      c++;
      if (c == t + 1) break;
    }
    if (c == t + 1) break;
  }
  if (n % 2 == 1) {
    for (int i = 2; i <= t + 1; i++) {
      cout << i << " " << t + 1 << endl;
    }
  } else if (n % 2 == 0) {
    for (int i = 2; i < t + 1; i++) {
      cout << i << " " << t + 1 << endl;
    }
  }
  return 0;
}
