#include <bits/stdc++.h>
using namespace std;
template <class T, class U>
inline bool chkmax(T& a, U b) {
  return (a < b) ? (a = b, true) : false;
}
template <class T, class U>
inline bool chkmin(T& a, U b) {
  return (a > b) ? (a = b, true) : false;
}
template <class T>
inline vector<T> uniq(vector<T> vec) {
  sort((vec).begin(), (vec).end()),
      vec.erase(unique((vec).begin(), (vec).end()), end(vec));
  return vec;
}
void Main();
int32_t main(int argc, char** argv) {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int T = 1;
  while (T--) Main();
}
const int Move[][2] = {{1, 0}, {0, 1}};
void Main() {
  int n;
  cin >> n;
  vector<pair<int, int> > ans(1, {1, 1});
  for (int i = 1; i < n; i++) {
    pair<int, int> cur;
    cur.first = ans.back().first + Move[i & 1][0];
    cur.second = ans.back().second + Move[i & 1][1];
    ans.push_back(cur);
  }
  cout << max(ans.back().first, ans.back().second) << "\n";
  for (auto& x : ans) cout << x.first << " " << x.second << "\n";
}
