#include <bits/stdc++.h>
using namespace std;
const long long MAX = 1;
const int inf = 1e9 + 10;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int x, y, z;
  cin >> x;
  cout << x / 2 + 1 << endl;
  for (int i = 1; i <= x; i++) {
    if (i & 1)
      cout << i / 2 + 1 << " " << i / 2 + 1 << endl;
    else
      cout << i / 2 << " " << i / 2 + 1 << endl;
  }
  return 0;
}
