#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, m;
  cin >> n;
  if (n % 2 != 0)
    m = (n + 1) / 2;
  else
    m = (n + 2) / 2;
  vector<pair<int, int> > cor;
  int i;
  for (i = 1; i <= m; i++) cor.push_back({1, i});
  for (i = 2; i <= n - m + 1; i++) cor.push_back({i, m});
  cout << m << "\n";
  for (i = 0; i < n; i++) {
    cout << cor[i].first << " " << cor[i].second << "\n";
  }
  return 0;
}
