#include <bits/stdc++.h>
using namespace std;
const long long INF = 2e18;
bool prime[100010];
void SieveOfEratosthenes(long long n) {
  memset(prime, true, sizeof(prime));
  for (long long p = 2; p * p <= n; p++) {
    if (prime[p] == true) {
      for (long long i = p * p; i <= n; i += p) prime[i] = false;
    }
  }
}
long long power(long long x, long long y) {
  if (y == 0)
    return 1;
  else if (y % 2 == 0)
    return power(x, y / 2) * power(x, y / 2);
  else
    return x * power(x, y / 2) * power(x, y / 2);
}
long long power1(long long a, long long b) {
  long long res = 1;
  while (b) {
    if (b & 1) {
      res *= a;
    }
    a = a * a;
    b >>= 1;
  }
  return res;
}
long long mod_power(long long a, long long b, long long m) {
  long long res = 1;
  a %= m;
  while (b) {
    if (b & 1) {
      res = res * a % m;
    }
    a = a * a % m;
    b >>= 1;
  }
  return res;
}
long long printDivisors(long long n) {
  long long count = 0;
  for (long long i = 1; i <= sqrt(n); i++) {
    if (n % i == 0) {
      if (n / i == i)
        count++;
      else
        printf("%d %d ", i, n / i);
    }
  }
}
bool isPrime(int n) {
  if (n <= 1) return false;
  if (n <= 3) return true;
  if (n % 2 == 0 || n % 3 == 0) return false;
  for (int i = 5; i * i <= n; i = i + 6)
    if (n % i == 0 || n % (i + 2) == 0) return false;
  return true;
}
long long par[1000001];
long long ranki[1000001] = {0};
long long find(long long x) {
  if (par[x] != x) {
    par[x] = find(par[x]);
  }
  return par[x];
}
void unionset(long long x, long long y) {
  long long xr = find(x);
  long long yr = find(y);
  if (ranki[xr] > ranki[yr]) {
    par[yr] = xr;
  } else if (ranki[xr] < ranki[yr]) {
    par[xr] = yr;
  } else {
    par[yr] = xr;
    ranki[xr]++;
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n;
  cin >> n;
  long long m = ceil((double)(n + 1) / 2.0);
  cout << m << endl;
  if (n % 2 == 0) {
    for (long long i = 1; i <= n / 2; i++) {
      cout << 1 << " " << i << endl;
    }
    for (long long i = 1; i <= n / 2; i++) {
      cout << m << " " << i << endl;
    }
  } else {
    for (long long i = 1; i <= n / 2; i++) {
      cout << 1 << " " << i << endl;
    }
    for (long long i = 1; i <= n / 2 + 1; i++) {
      cout << m << " " << i << endl;
    }
  }
}
