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