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