#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
const int maxn = 3e5 + 10;
int n;
int main() {
  while (~scanf("%d", &n)) {
    if (n & 1) {
      int m = (n + 1) / 2;
      printf("%d\n", m);
      for (int i = 1; i <= m; ++i) {
        printf("1 %d\n", i);
      }
      for (int i = m + 1; i <= n; ++i) {
        printf("%d %d\n", m, i - m + 1);
      }
    } else {
      int m = n / 2 + 1;
      printf("%d\n", m);
      for (int i = 1; i <= m; ++i) {
        printf("1 %d\n", i);
      }
      for (int i = m + 1; i <= n; ++i) {
        printf("%d %d\n", m, i - m + 1);
      }
    }
  }
  return 0;
}
