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