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