#include <bits/stdc++.h>
#pragma warning(disable : 4996);
const long long INF = 4294967295;
const int MAXN = 1e5 + 10;
const int MOD = 1e9 + 7;
using namespace std;
int main() {
  int n, m;
  while (cin >> n) {
    for (m = 1;; m++) {
      if (2 * (m - 1) >= n - 1) break;
    }
    cout << m << endl;
    for (int i = 1; i <= n / 2; i++) {
      cout << 1 << " " << i << endl;
    }
    for (int i = n / 2 + 1; i <= n; i++) {
      cout << m << " " << m - n + i << endl;
    }
  }
}
