#include <bits/stdc++.h>
const double pi = acos(-1);
const long long mod = 1e9 + 7;
const int N = 2e5 + 5, M = 505;
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n, m;
  cin >> n;
  m = n / 2 + 1;
  cout << m << "\n";
  for (int i = 1; i <= m; i++) {
    cout << "1 " << i << "\n";
  }
  if (n % 2 == 0)
    for (int i = 3; i <= m; i++) cout << m << " " << i << "\n";
  else
    for (int i = 2; i <= m; i++) cout << m << " " << i << "\n";
  return 0;
}
