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