#include <bits/stdc++.h>
#pragma optimize("", off)
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma comment(linker, "/STACK:36777216")
using namespace std;
int main() {
  long long int n;
  cin >> n;
  if (n == 1) {
    cout << "1\n1 1";
  } else if (n == 2) {
    cout << "2\n";
    cout << "1 1\n"
         << "2 2\n";
  } else {
    long long int x = n + 1;
    long long int ans = 0;
    if (x % 2 == 1) ans++;
    ans += (x / 2);
    cout << ans << "\n";
    for (long long int i = 1; i <= ans; i++) cout << "1 " << i << "\n";
    long long int j = 2;
    for (long long int i = ans + 1; i <= n; i++)
      cout << ans << " " << j++ << "\n";
  }
}
