#include <bits/stdc++.h>
using namespace std;
void Weapons19() {
  cin.sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
}
int32_t main() {
  Weapons19();
  long long n;
  cin >> n;
  long long m;
  for (m = 1;; m++) {
    if (m * 2 - 1 >= n) break;
  }
  cout << m << "\n";
  long long t = 0;
  for (long long i = 1; i <= m; i++) {
    cout << i << " " << 1 << "\n";
    t++;
    if (t == n) return 0;
  }
  for (long long i = 2; i <= m; i++) {
    cout << m << " " << i << "\n";
    t++;
    if (t == n) return 0;
  }
}
