#include <bits/stdc++.h>
const long double pie = 3.1415926535;
using namespace std;
long long fpow(long long n, long long p) {
  ;
  long long m = 1;
  while (p) {
    if (p % 2) m *= n;
    p >>= 1;
    n *= n;
  }
  return m;
}
long long mfpow(long long n, long long p, long long M) {
  long long m = 1;
  n %= M;
  while (p) {
    if (p % 2) m = (m * n) % M;
    n = (n * n) % M;
    p >>= 1;
  }
  return m % M;
}
long long min() { return 1e18; }
long long min(long long a) { return a; }
long long min(long long a, long long b) {
  if (a < b)
    return a;
  else
    return b;
}
template <typename... Args>
long long min(long long a, long long b, Args... args) {
  if (a < b)
    return min(a, args...);
  else
    return min(b, args...);
}
long long max() { return -1e18; }
long long max(long long a) { return a; }
long long max(long long a, long long b) {
  if (a < b)
    return b;
  else
    return a;
}
template <typename... Args>
long long max(long long a, long long b, Args... args) {
  if (a < b)
    return max(b, args...);
  else
    return max(a, args...);
}
const vector<long long> days = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
bool br1, br2, br;
char ch, ch1, ch2;
long long n, k, x, y, z, mini, maxi, l, ind, ini, sum, t, len, r, w, imini, m;
pair<long long, long long> p;
string s, s1, s2;
void solve() {
  cin >> n;
  for (long long i = 1; i < 1e5; i++) {
    if (2 * i - 1 >= n) {
      cout << i << endl;
      x = 1;
      y = 1;
      for (long long j = 0; j < n; j++) {
        cout << x << " " << y << endl;
        if (y == i)
          x++;
        else
          y++;
      }
      break;
    }
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  solve();
  return 0;
}
