#include <bits/stdc++.h>
using namespace std;
int n;
int main() {
  ios::sync_with_stdio(false);
  cin >> n;
  cout << n / 2 + 1 << endl;
  for (int i = 1; i <= n; i++) {
    if (i & 1)
      cout << (i + 1) / 2 << " " << (i + 1) / 2 << endl;
    else
      cout << i / 2 + 1 << " " << i / 2 << endl;
  }
}
