#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n;
  cin >> n;
  int m = (n + 1) / 2;
  if (n % 2 == 0) m++;
  cout << m << "\n";
  int a[m][m], i, j;
  memset(a, 0, sizeof(a));
  for (i = 0; i < m; i++) a[0][i] = 1;
  int tot = n - m;
  i = 1;
  while (tot--) {
    a[i][m - 1] = 1;
    i++;
  }
  for (i = 0; i < m; i++) {
    for (j = 0; j < m; j++) {
      if (a[i][j] != 0) {
        cout << i + 1 << " " << j + 1 << "\n";
      }
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  int tc = 0;
  if (tc) {
    int tcs;
    cin >> tcs;
    while (tcs--) solve();
  } else
    solve();
}
