#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  scanf("%d", &n);
  if (n == 1)
    cout << 1 << "\n" << 1 << " " << 1 << "\n";
  else {
    m = (n / 2) + 1;
    cout << m << "\n";
    int cnt = 0;
    for (int i = 1; i <= m; i++) {
      cout << i << " " << i << "\n";
      cnt++;
      if (cnt == n) break;
      cout << i << " " << i + 1 << "\n";
      cnt++;
      if (cnt == n) break;
    }
  }
}
