#include <bits/stdc++.h>
using namespace std;
int main() {
  std::ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  cin >> n;
  int ans = n + 1;
  if (ans % 2) ans++;
  ans /= 2;
  cout << ans << endl;
  int left = n;
  for (int i = 1; i <= ans; i++) {
    cout << i << " " << 1 << endl;
    left--;
  }
  for (int i = 2; i <= ans && left > 0; i++, left--) {
    cout << ans << " " << i << endl;
  }
  return 0;
}
