#include <bits/stdc++.h>
long long mod = 1e9 + 7;
void fail() {
  std::cout << "OVERFLOW!!!\n";
  exit(0);
}
using namespace std;
int32_t main() {
  long long n;
  cin >> n;
  vector<pair<long long, long long> > ans;
  long long pre = 1;
  for (long long i = 1; i <= n; i++) {
    if (i % 2 == 1) {
      ans.push_back({pre, pre});
    } else {
      ans.push_back({pre, pre + 1});
      pre++;
    }
  }
  cout << ans[n - 1].second << '\n';
  for (auto i : ans) cout << i.first << ' ' << i.second << '\n';
  return 0;
}
