#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, sum = 0;
  cin >> n;
  int m;
  if (n % 2 == 1) {
    m = (n + 1) / 2;
  } else
    m = n / 2 + 1;
  cout << m << "\n";
  for (int i = 1; i <= m; i++) {
    if (sum >= n) break;
    for (int j = 1; j < m; j++) {
      if (i == 1) {
        cout << 1 << " " << j << "\n";
        sum++;
      }
    }
    cout << i << " " << m << "\n";
    sum++;
  }
  return 0;
}
