#include <bits/stdc++.h>
using namespace std;
bool SortbySecDesc(const pair<long long, long long> &a,
                   const pair<long long, long long> &b) {
  return a.second > b.second;
}
bool sortinrev(const pair<int, int> &a, const pair<int, int> &b) {
  return (a.first > b.first);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(nullptr);
  ;
  long long n;
  cin >> n;
  cout << (n / 2) + 1 << endl;
  long long ans = 1, ans1 = 1;
  for (int i = 1; i <= n; i++) {
    cout << ans << " " << ans1 << endl;
    if (i & 1)
      ans1++;
    else
      ans++;
  }
  return 0;
}
