#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  cout << n / 2 + 1 << endl;
  int i = 1, j = 1;
  for (int l = 0; l < n; l++) {
    cout << i << ' ' << j << '\n';
    if (i == j)
      j++;
    else
      i++;
  }
  return 0;
}
