#include <bits/stdc++.h>
using namespace std;
int main() {
  int m;
  cin >> m;
  if (m % 2 == 0) {
    cout << m / 2 + 1 << endl;
  } else {
    cout << (m - 1) / 2 + 1 << endl;
  }
  int r = 1;
  int c = 0;
  for (int i = 0; i < m - 1; i += 2) {
    c = c + 1;
    cout << r << " " << c << endl;
    r = r + 1;
    cout << r << " " << c << endl;
  }
  if (m % 2 != 0) {
    c = c + 1;
    cout << r << " " << c << endl;
  }
}
