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