#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  long long int n;
  cin >> n;
  vector<pair<long long int, long long int> > cord;
  long long int i, r = 1, c = 1, mx = -1;
  for (i = 1; i <= n; i++) {
    mx = max(mx, r);
    mx = max(mx, c);
    cord.push_back(make_pair(r, c));
    if (i % 2 == 0) {
      r++;
    } else {
      c++;
    }
  }
  cout << mx << "\n";
  for (i = 0; i < cord.size(); i++) {
    cout << cord[i].first << " " << cord[i].second << "\n";
  }
  return 0;
}
