#include <bits/stdc++.h>
using namespace std;
struct kk {
  int x;
  int y;
} k[1005];
int main() {
  long long n;
  cin >> n;
  long long w = n;
  long long len;
  n = n + 1;
  if (n % 2 == 0)
    len = n / 2;
  else
    len = n / 2 + 1;
  cout << len << endl;
  k[1].x = 1;
  k[1].y = 1;
  for (int i = 2; i <= len; i++) {
    k[i].x = k[i - 1].x + 1;
    k[i].y = k[i - 1].y;
  }
  for (int i = len + 1; i <= w; i++) {
    k[i].x = k[i - 1].x;
    k[i].y = k[i - 1].y + 1;
  }
  for (int i = 1; i <= w; i++) {
    cout << k[i].x << " " << k[i].y << endl;
  }
  return 0;
}
