#include <bits/stdc++.h>
using namespace std;
int n;
int x = 1, y = 1;
int main() {
  cin >> n;
  cout << (1 + n + 1) / 2 << endl;
  for (int i = 0; i < n; i++) {
    cout << x << " " << y << endl;
    if (i % 2 == 0)
      y++;
    else
      x++;
  }
  return 0;
}
