#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  if (n == 1) {
    cout << "1\n1 1" << '\n';
  } else if (n == 2) {
    cout << "2\n1 1\n1 2" << '\n';
  } else {
    int m = 1 + (n) / 2;
    cout << m << '\n';
    for (int i = 0, flag = 0; i < n; i++) {
      if (flag == 0) {
        cout << "1 " << i + 1 << '\n';
        if (i + 1 == m) flag = 1;
      } else {
        cout << 2 + i - m << " " << m << '\n';
      }
    }
  }
  return 0;
}
