#include <bits/stdc++.h>
using namespace std;
template <class nmsl>
inline void read(nmsl &x) {
  x = 0;
  char ch = getchar(), w = 0;
  while (!isdigit(ch)) w = (ch == '-'), ch = getchar();
  while (isdigit(ch)) x = (x << 1) + (x << 3) + (ch ^ 48), ch = getchar();
  x = w ? -x : x;
}
int n;
int main() {
  read(n);
  printf("%d\n", (n / 2) + 1);
  for (register int i = 1, qa = 1, qb = 1; i <= n; i++) {
    printf("%d %d\n", qa, qb);
    if (i & 1)
      qa++;
    else
      qb++;
  }
  return 0;
}
