#include <bits/stdc++.h>
using namespace std;
int n, x, y;
int main() {
  cin >> n;
  if (n % 2)
    cout << (n + 1) / 2;
  else
    cout << n / 2 + 1;
  cout << endl;
  x = y = 1;
  for (int i = 1; i <= n; i++) {
    cout << x << ' ' << y << endl;
    if (i % 2)
      y++;
    else
      x++;
  }
  return 0;
}
