#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1);
const long long mod = 1e9 + 7;
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  int test = 1;
  while (test--) {
    int n, x = 0, y = 1;
    cin >> n;
    int l[n], r[n];
    for (int i = 0; i < n; i++) {
      if (i % 2 == 0)
        x++;
      else
        y++;
      l[i] = x;
      r[i] = y;
    }
    cout << y << "\n";
    for (int i = 0; i < n; i++) {
      cout << l[i] << " " << r[i] << "\n";
    }
  }
  return 0;
}
