#include <bits/stdc++.h>
using namespace std;
pair<int, int> t[10000];
int main() {
  int n;
  scanf("%d", &n);
  int k = 1, m = 1;
  k = n + 1;
  if (k & 1) {
    m = k / 2 + 1;
  } else
    m = k / 2;
  t[1] = pair<int, int>(1, 1);
  int j = 2;
  for (int i = 1; i <= m; ++i) {
    for (int f = 2; f <= m; ++f) {
      if ((i - 1) + (f - 1) >= (j - 1)) {
        t[j++] = pair<int, int>(i, f);
        if (j == n + 1) break;
      }
    }
    if (j == n + 1) break;
  }
  printf("%d\n", m);
  for (int i = 1; i <= n; ++i) {
    printf("%d %d\n", t[i].first, t[i].second);
  }
  return 0;
}
