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