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