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