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