#include <bits/stdc++.h>
using namespace std;
const int MAX = 1e5 + 10;
const long long MOD = 1e9 + 7;
int N, M, K, Q;
int main() {
  int i, j;
  int n, m;
  scanf("%d", &n);
  m = n / 2 + 1;
  printf("%d\n", m);
  for (i = 1; i <= n / 2; ++i) printf("%d %d\n", i, 1);
  int cnt = m - n / 2;
  for (i = n; i > n / 2; --i, ++cnt) printf("%d %d\n", cnt, m);
}
