#include <bits/stdc++.h>
using namespace std;
int n;
int main() {
  int i, t, m, n, u, sum, maxs, mins, x, y, z;
  scanf("%d", &n);
  m = n / 2 + 1;
  printf("%d\n", m);
  for (i = 1; i <= m; ++i) printf("%d %d\n", 1, i);
  for (i = 2; i <= n - m + 1; ++i) printf("%d %d\n", i, m);
  return 0;
}
