#include <bits/stdc++.h>
using namespace std;
void file() {}
void test_case() {
  int n, i, ans;
  cin >> n;
  ans = n / 2 + 1;
  printf("%d", ans);
  for (i = 1; i <= ans; ++i) printf("\n%d 1", i);
  for (i = 2; i <= n - ans + 1; ++i) printf("\n%d %d", ans, i);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  file();
  int T = 1;
  for (int nr = 1; nr <= T; ++nr) {
    test_case();
  }
}
