#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int m = ceil((n + 1) * 1.0 / 2);
  cout << m << endl;
  for (int i = 1; i <= m; i++) {
    cout << "1 " << i << endl;
  }
  for (int i = 1; i <= n - m; i++) {
    cout << i + 1 << " " << m << endl;
  }
}
