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