#include <bits/stdc++.h>
using namespace std;
const int NN = 100010;
const int inf = 0x3f3f3f3f;
int main() {
  int n;
  cin >> n;
  int m = n / 2 + 1;
  cout << m << endl;
  for (int i = 1; i <= m; i++) cout << 1 << " " << i << endl;
  n -= m;
  n++;
  for (int i = 2; i <= n; i++) cout << i << " " << m << endl;
  return 0;
}
