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