#include <bits/stdc++.h>
using namespace std;
int n, c, r;
int main() {
  cin >> n;
  cout << n / 2 + 1 << endl;
  for (int i = 1; i <= n; i++) {
    r = (i + 1) / 2;
    c = i / 2 + 1;
    cout << r << " " << c << endl;
  }
  return 0;
}
