#include <bits/stdc++.h>
using namespace std;
int ceil(int x, int y) {
  if (x % y == 0) {
    return x / y;
  }
  return x / y + 1;
}
int main() {
  int n, i, j, k, l = 10000000;
  cin >> n;
  cout << ceil(n + 1, 2) << endl;
  j = 1;
  k = 1;
  for (i = 1; i <= n; i++) {
    cout << j << " " << k << endl;
    if (i % 2 == 1) {
      k++;
    } else {
      j++;
    }
  }
}
