#include <bits/stdc++.h>
using namespace std;
long long MOD = 998244353;
string alpha_upper = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
string alpha_lower = "abcdefghijklmnopqrstuvwxyz";
double eps = 1e-12;
template <class T>
void print_array(T v[], long long size) {
  for (int i = 0; i < size; i++) {
    cout << v[i] << " ";
  }
  cout << endl;
}
template <class T1>
void print_vector(vector<T1> v, long long size) {
  for (int i = 0; i < size; i++) {
    cout << v[i] << " ";
  }
  cout << endl;
}
template <class Tm1, class Tm2>
void print_map(map<Tm1, Tm2> m) {
  for (auto it = m.begin(); it != m.end(); it++) {
    cout << (*it).first << " : " << (*it).second << endl;
  }
}
void solve() {
  long long n, y;
  cin >> n;
  if (n % 2 == 0)
    y = n / 2;
  else
    y = (n - 1) / 2;
  y++;
  cout << y << endl;
  cout << 1 << " " << 1 << endl;
  n--;
  if (y > 1) {
    for (long long i = 0; i < y; i += 1) {
      if (!n) break;
      cout << i + 1 << " " << 2 << endl;
      n--;
    }
    for (long long i = 2; i < y; i += 1) {
      if (!n) break;
      n--;
      cout << y << " " << i + 1 << endl;
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  solve();
  return 0;
}
