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