#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0), cout.tie(0);
  long long n;
  cin >> n;
  vector<pair<long long, long long>> ans;
  ans.push_back({1, 1});
  long long x = 1, y = 1;
  for (int i = 1; i < n; ++i) {
    if (i & 1) {
      x++;
    } else {
      y++;
    }
    ans.push_back({x, y});
  }
  long long mx = 0;
  for (auto i : ans) {
    mx = max({mx, i.first, i.second});
  }
  cout << mx << '\n';
  for (auto i : ans) {
    cout << i.first << ' ' << i.second << '\n';
  }
  return 0;
}
