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