#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n;
  cin >> n;
  cout << (n / 2) + 1 << "\n";
  long long int i;
  for (i = 1; i <= (n / 2) + 1; i++) {
    cout << i << " " << 1 << "\n";
  }
  i--;
  n = n - ((n / 2) + 1);
  for (long long int j = 1; j <= n; j++) cout << i << " " << j + 1 << "\n";
}
