#include <bits/stdc++.h>
using namespace std;
void c_p_c() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
}
void solve() {
  long long n;
  cin >> n;
  long long ans = (n / 2) + 1;
  long long a = 1, b = 1;
  bool flag = 0;
  cout << ans << "\n";
  for (long long i = 0; i < (n); ++i) {
    cout << a << " " << b;
    cout << "\n";
    if (!flag) {
      ++b;
      flag = 1;
    } else {
      ++a;
      flag = 0;
    }
  }
}
int32_t main() {
  c_p_c();
  solve();
  return 0;
}
