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