#include <bits/stdc++.h>
long long int mod = 1000000007;
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  cin >> n;
  int m = (n / 2) + 1;
  cout << m << endl;
  for (int i = 1; i <= m; i++) cout << i << " 1" << endl;
  for (int i = 2; i <= n - m + 1; i++) cout << m << " " << i << endl;
  return 0;
}
