#include <bits/stdc++.h>
using namespace std;
const int8_t INFC = 0x3f;
const int16_t INFS = 0x3f3f;
const int32_t INF = 0x3f3f3f3f;
const int64_t INFL = 0x3f3f3f3f3f3f3f3fLL;
int main() {
  ios::sync_with_stdio(0);
  int n;
  cin >> n;
  cout << (n + 2) / 2 << endl;
  int x = 1, y = 1, dir = 0;
  for (int i = 0; i < n; i++) {
    cout << x << " " << y << endl;
    if (dir == 0)
      y++;
    else
      x++;
    dir ^= 1;
  }
  return 0;
}
