#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  if (n == 1) {
    cout << 1 << endl << 1 << ' ' << 1 << endl;
    return 0;
  }
  int i = 2;
  while (1) {
    int dis = 2 * (i - 1);
    if (n - 1 <= dis) {
      cout << i << endl;
      int r = 1, c = 1, f = 1;
      for (int j = 1; j <= n; j++) {
        cout << r << ' ' << c << endl;
        if (f == 1)
          c++;
        else
          r++;
        f = f * -1;
      }
      break;
    }
    i++;
  }
  return 0;
}
