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