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