#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  long long k = n / 2 + 1;
  cout << k << endl;
  long long cnt = 0;
  for (long long i = 1; i <= k; i++) {
    if (cnt < n) {
      cout << i << " " << i << endl;
      cnt++;
    }
    if (cnt < n) {
      cout << i << " " << i + 1 << endl;
      cnt++;
    }
  }
}
