#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
void solve() {
  long long n, m = 0, x = 1, y = 1;
  cin >> n;
  m = n / 2 + 1;
  cout << m << "\n";
  for (long long t = 1; t <= n; t++) {
    cout << x << " " << y << "\n";
    if (t % 4 == 1) y++;
    if (t % 4 == 2) x++;
    if (t % 4 == 3) x++;
    if (t % 4 == 0) y++;
  }
}
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long t = 1;
  while (t--) solve();
  return 0;
}
