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