#include <bits/stdc++.h>
#pragma gcc optimize("O3")
const int mod = 1e5 + 7;
const long long inf = 0x3f3f3f3f3f3f3f3f;
const long double pi = 3.1415926535897932384626433832795;
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  int sol = n / 2 + 1;
  cout << sol << "\n";
  for (int i = 0; i < int(n); i++)
    cout << 1 + i / 2 << " " << 1 + (i + 1) / 2 << "\n";
}
