#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int d = 1;
  while (2 * d <= n) {
    d++;
  }
  cout << d << endl;
  int c = 0;
  int e = 0;
  int j;
  for (int i = 1; i <= d; i++) {
    for (j = 1; j <= d; j++) {
      cout << i << " " << j << endl;
      c++;
      if (c == n) {
        e = 1;
        break;
      }
    }
    if (e = 1) break;
  }
  int i = 2;
  int l = n - c;
  while (l--) {
    j = d;
    cout << i << " " << j << endl;
    c++;
    if (c == n) {
      e = 1;
      break;
    }
    i++;
  }
  return 0;
}
