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