#include <bits/stdc++.h>
#pragma gcc optimize(o3)
using namespace std;
const int N = 2e5 + 5;
int main() {
  int n, m = 1, r = 1, c = 1;
  scanf("%d", &n);
  if (n & 1)
    m = (n + 1) / 2;
  else
    m = (n / 2) + 1;
  printf("%d\n", m);
  for (int i = 0; i < n; i++) {
    printf("%d %d\n", r, c);
    i & 1 ? r++ : c++;
  }
  return 0;
}
