#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int n;
  cin >> n;
  long long int x = (n / 2) + 1;
  cout << x << "\n";
  long long int r = 1, c = 1;
  for (long long int i = 1; i < n; i++) {
    cout << r << " " << c << "\n";
    if (c != x) {
      c++;
    } else {
      r++;
    }
  }
  cout << x << " " << x << "\n";
}
