#include <bits/stdc++.h>
using namespace std;
bool b2(const pair<pair<int, int>, int> &p1,
        const pair<pair<int, int>, int> &p2) {
  return p1.first.first > p2.first.first;
}
bool b1(const pair<pair<int, int>, int> &p1,
        const pair<pair<int, int>, int> &p2) {
  return p1.first.second < p2.first.second;
}
int gcd(int a, int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
int main() {
  int n;
  cin >> n;
  int m = ceil((double)(n + 1) / (double)(2));
  cout << m << endl;
  for (int i = 1; i <= m; i++) {
    cout << "1 " << i << endl;
  }
  for (int i = 2; i < 2 + (n - m); i++) cout << i << " " << m << endl;
  return 0;
}
