#include <bits/stdc++.h>
using namespace std;
int N, res;
int main() {
  scanf("%d", &N);
  res = N / 2 + 1;
  printf("%d\n", res);
  for (int i = 1; i <= res; ++i) printf("1 %d\n", i);
  for (int i = 2; i <= N - res + 1; ++i) printf("%d %d\n", i, res);
  return 0;
}
