#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10;
int n, m;
void print(vector<pair<int, int> > v) {
  for (int i = 0; i < v.size(); ++i)
    cout << v[i].first << " " << v[i].second << endl;
  exit(0);
}
int main() {
  cin >> n;
  int diff = n;
  int board = 0;
  for (int i = 1; i < 2000; ++i) {
    if (2 * i - 1 >= diff) {
      board = i;
      break;
    }
  }
  cout << board << endl;
  vector<pair<int, int> > sol;
  int sofar = n;
  for (int i = 1; i <= board; ++i) {
    if (sofar-- == 0) print(sol);
    sol.push_back({i, 1});
  }
  for (int i = 2; i <= board; ++i) {
    if (sofar-- == 0) print(sol);
    sol.push_back({board, i});
  }
  if (sofar == 0) print(sol);
  assert(0);
}
