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