#include <bits/stdc++.h>
using namespace std;
template <typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
  cout << *it << '=' << a << endl;
  err(++it, args...);
}
vector<string> tokenizer(string str, char ch) {
  std::istringstream var((str));
  vector<string> v;
  string t;
  while (getline((var), t, (ch))) {
    v.push_back(t);
  }
  return v;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int t = 1;
  cin >> t;
  cout << (t + 2) / 2 << '\n';
  for (long long int i = 1; i <= (t / 2); i++) {
    cout << i << ' ' << i << '\n';
    cout << i << ' ' << i + 1 << '\n';
  }
  if (t % 2 == 1) {
    cout << (t + 2) / 2 << ' ' << (t + 2) / 2;
  }
  return 0;
}
