#include <bits/stdc++.h>
template <typename A, typename B>
inline char smax(A &a, const B &b) {
  return a < b ? a = b, 1 : 0;
}
template <typename A, typename B>
inline char smin(A &a, const B &b) {
  return b < a ? a = b, 1 : 0;
}
template <typename I>
inline void read(I &x) {
  int f = 0, c;
  while (!isdigit(c = getchar())) c == '-' ? f = 1 : 0;
  x = c & 15;
  while (isdigit(c = getchar())) x = (x << 1) + (x << 3) + (c & 15);
  f ? x = -x : 0;
}
const int N = 1000 + 7;
int n;
inline void work() {
  printf("%d\n", n / 2 + 1);
  int m = n / 2 + 1;
  for (int i = 1; i <= n / 2; ++i)
    if (i & 1)
      printf("%d %d\n", i, 1);
    else
      printf("%d %d\n", 1, i);
  for (int i = n / 2 + 1; i <= n; ++i)
    if (i & 1)
      printf("%d %d\n", m, i - m + 1);
    else
      printf("%d %d\n", i - m + 1, m);
}
inline void init() { read(n); }
int main() {
  init();
  work();
  fclose(stdin), fclose(stdout);
}
