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