#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n, m;
  cin >> n;
  if ((n - 1) & 1) {
    long long k = 1, second = 2;
    m = ((n - 1) / 2) + 2;
    cout << m << endl;
    for (int i = 0; i < n; i++) {
      if (k <= m) {
        cout << "1"
             << " " << k << endl;
        k++;
      } else {
        cout << second << " " << k - 1 << endl;
        second++;
      }
    }
  } else {
    long long k = 1, second = 2;
    m = ((n - 1) / 2) + 1;
    cout << m << endl;
    for (int i = 0; i < n; i++) {
      if (k <= m) {
        cout << "1"
             << " " << k << endl;
        k++;
      } else {
        cout << second << " " << k - 1 << endl;
        second++;
      }
    }
  }
  return 0;
}
