#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e3 + 5;
int n, m, k;
int a[maxn][maxn], c[maxn][maxn];
int ans, tmp, cnt;
int flag;
pair<int, int> stk[maxn];
int jud(int x, int y, int v) {
  for (register int i = (1); i <= (cnt); i++) {
    if (abs(stk[i].first - x) + abs(stk[i].second - y) < abs(v - i)) return 0;
  }
  return 1;
}
int main() {
  int T, cas = 1;
  scanf("%d", &n);
  int m = 1;
  cnt = 0;
  while (cnt < n) {
    for (register int i = (1); i <= (m); i++)
      if (!c[i][m] && jud(i, m, cnt + 1)) {
        c[i][m] = 1;
        stk[++cnt] = make_pair(i, m);
        if (cnt == n) break;
      }
    if (cnt == n) break;
    for (register int i = (1); i <= (m); i++)
      if (!c[m][i] && jud(m, i, cnt + 1)) {
        c[m][i] = 1;
        stk[++cnt] = make_pair(m, i);
        if (cnt == n) break;
      }
    if (cnt == n) break;
    m++;
  }
  printf("%d\n", m);
  for (register int i = (1); i <= (cnt); i++)
    printf("%d %d\n", stk[i].first, stk[i].second);
  return 0;
}
