#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int t, i, j = 0, n;
  cin >> n;
  long long int r[n + 1], c[n + 1], mx = 0, count = 0, r1 = 1, c1 = 1;
  while (count != n) {
    r[j] = r1;
    c[j] = c1;
    mx = max(mx, r1);
    mx = max(mx, c1);
    if (r1 > c1)
      c1++;
    else
      r1++;
    count++;
    j++;
  }
  cout << mx << endl;
  for (i = 0; i < j; i++) cout << r[i] << " " << c[i] << endl;
}
