#include <bits/stdc++.h>
using namespace std;
void err(istream_iterator<string> it) {}
template <typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
  cerr << *it << " = " << a << "\n";
  err(++it, args...);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin.tie(NULL);
  long long int n, m, i, j, k, ans = 0;
  cin >> n;
  cout << (n + 2) / 2 << "\n";
  long long int l = 1, r = 1;
  for (i = 0; i < n; i++) {
    cout << l << " " << r << "\n";
    if (i % 2 == 0)
      r++;
    else
      l++;
  }
  return 0;
}
