#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n;
  cin >> n;
  long long t = n;
  if (t % 2 == 0) t++;
  long long tp = (t + 1) / 2;
  cout << tp << endl;
  for (long long i = 1; i <= tp; i++) cout << "1 " << i << endl;
  n = n - tp;
  for (long long i = 2; n > 0; n--, i++) {
    cout << i << " " << tp << endl;
  }
}
