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