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