#include <bits/stdc++.h>
int main() {
  long long int n;
  scanf("%lld", &n);
  printf("%lld\n", n / 2 + 1);
  long long int count1 = 0;
  long long int count2 = 1;
  for (int i = 1; i <= n; i++) {
    if (i % 2 == 0) {
      count2++;
    } else {
      count1++;
    }
    printf("%lld %lld\n", count1, count2);
  }
  return 0;
}
