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