#include <bits/stdc++.h>
using namespace std;
pair<int, int> dir[] = {{0, -1}, {0, 1},  {-1, 0}, {1, 0},
                        {1, 1},  {1, -1}, {-1, 1}, {-1, -1}};
int N;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> N;
  int v = 0;
  for (int i = 1; i <= 5000; i++) {
    if (i * 2 > N) {
      v = i;
      break;
    }
  }
  cout << v << "\n";
  int x = N / 2;
  int cnt = 1;
  while (x--) {
    cout << 1 << " " << cnt++ << "\n";
  }
  x = N - (N / 2);
  cnt = 1;
  while (x--) {
    cout << v << " " << cnt++ << "\n";
  }
}
