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