#include <bits/stdc++.h>
using namespace std;
int main() {
  long long i, j, n, k, l, o, m;
  cin >> n;
  l = n;
  if (n % 2 != 0) l--;
  l = n / 2;
  l = l - 1;
  l = l + 2;
  cout << l << endl;
  for (i = 0; i < n / 2; i++) {
    cout << 1 << " " << i + 1 << endl;
  }
  for (i = 0; i < n / 2; i++) {
    cout << l << " " << i + 1 << endl;
  }
  if (n % 2 != 0) {
    cout << l << " " << (n / 2) + 1;
  }
}
