#include <bits/stdc++.h>
using namespace std;
long long power(long long num, long long g, long long mod) {
  if (g == 0) return 1;
  if (g % 2 == 1) return (num * power((num * num) % mod, g / 2, mod)) % mod;
  return power((num * num) % mod, g / 2, mod);
}
long long stringtonum(string s) {
  stringstream str(s);
  long long x = 0;
  str >> x;
  return x;
}
int main() {
  long long n;
  cin >> n;
  long long i = (n % 2 == 0 ? n / 2 : (n + 1) / 2), j = n / 2 + 1;
  long long m = max(i, j);
  cout << m << "\n";
  long long k = 1, col = 1;
  while (i >= k) {
    cout << 1 << " " << col << "\n";
    k++;
    col++;
  }
  col = (n % 2 == 0) ? col = 1 : col = 2;
  while (k <= n) {
    cout << m << " " << col << "\n";
    k++;
    col++;
  }
  return 0;
}
