#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  int m = (n + 2) / 2;
  cout << m << '\n';
  int c = 0;
  for (int i = 0; i < m; i++) {
    cout << 1 << " " << i + 1 << '\n';
    c++;
  }
  for (int i = 2; i <= m; i++) {
    if (c < n) cout << i << " " << m << '\n', c++;
  }
}
