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