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