#include <bits/stdc++.h>
using namespace std;
inline void fast() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
int main() {
  fast();
  int n, m;
  cin >> n;
  if (n & 1)
    m = (n + 1) / 2;
  else
    m = (n) / 2 + 1;
  cout << m << endl;
  int k = 1, i;
  for (int i = 1; i <= m; i++) {
    if (k <= n) cout << 1 << " " << i << endl;
    k++;
  }
  for (int i = 2; i <= m; i++) {
    if (k <= n) {
      cout << i << " " << m << endl;
      k++;
    }
  }
}
