#include <bits/stdc++.h>
using namespace std;
long long abs(long long, long long);
void solve() {
  long long n;
  cin >> n;
  long long m;
  if ((n + 1) % 2 == 0)
    m = (n + 1) / 2;
  else
    m = (n + 1) / 2 + 1;
  cout << m << "\n";
  for (long long i = 1; i < m + 1; i++) {
    cout << i << " " << 1 << "\n";
  }
  for (long long i = 2; i < n - m + 2; i++) cout << m << " " << i << "\n";
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long TESTS = 1;
  while (TESTS--) {
    solve();
  }
  return 0;
}
long long abs(long long a, long long b) {
  if (a > b)
    return a - b;
  else
    return b - a;
}
