#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  int m = n / 2 + 1;
  cout << m << "\n";
  for (int i = 1; i <= m; i++) {
    cout << 1 << " " << i << "\n";
  }
  for (int i = 2; i <= n - m + 1; i++) {
    cout << m << " " << i << "\n";
  }
  return 0;
}
