#include <bits/stdc++.h>
using namespace std;
int main() {
  int t = 1;
  while (t--) {
    int n;
    cin >> n;
    int m = n;
    for (int i = 1; i <= n; i++)
      if ((i - 1) + (i - 1) >= n - 1) {
        m = i;
        break;
      }
    cout << m << endl;
    int a = 1, b = 1;
    for (int i = 0; i < n; i++) {
      cout << a << " " << b << endl;
      if (b + 1 <= m)
        b++;
      else
        a++;
    }
  }
  return 0;
}
