#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  float n;
  cin >> n;
  float m = (n - 1) / 2;
  int x = ceil(m);
  x++;
  cout << x << endl;
  int t = n;
  int i = 1, j = 1;
  while (n--) {
    cout << i << " " << j << endl;
    if (i < x)
      i++;
    else
      j++;
  }
}
