#include <bits/stdc++.h>
using namespace std;
struct node {
  int x;
  int y;
};
int main() {
  int n;
  int count;
  vector<node> p;
  vector<node>::iterator iterp1;
  while (cin >> n) {
    count = 0;
    node po;
    po.x = 1, po.y = 0;
    for (int i = 1; i <= n; i++) {
      if (i % 2 == 1) {
        po.y++;
        p.push_back(po);
      } else {
        po.x++;
        p.push_back(po);
      }
    }
    cout << po.x << endl;
    for (iterp1 = p.begin(); iterp1 < p.end(); iterp1++)
      cout << iterp1->x << " " << iterp1->y << endl;
    p.clear();
  }
  return 0;
}
