#include <bits/stdc++.h>
using namespace std;
long long power(long long a, long long b) {
  long long res = 1ll;
  while (b > 0) {
    if (b % 2 != 0) res = (res * a) % 1000000007;
    a = (a * a) % 1000000007;
    b /= 2;
  }
  return res;
}
long long ncr(long long n, long long k) {
  if (k > n - k) k = n - k;
  long long pro = 1;
  for (long long i = 0; i < k; i++) {
    pro = (pro * (n - i)) % 1000000007;
    pro /= (i + 1);
  }
  return (pro % 1000000007);
}
vector<long long> prime;
void seive() {
  vector<bool> isprime(2000001, true);
  for (int i = 2; i * i <= 2000000; i++) {
    if (isprime[i]) {
      for (int j = i * i; j <= 2000000; j += i) {
        isprime[j] = false;
      }
    }
  }
  for (int i = 2; i <= 1000000; i++) {
    if (isprime[i]) prime.push_back(i);
  }
}
int main(void) {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n;
  cin >> n;
  long long x = ceil((n + 1) / 2.0);
  int i;
  cout << x << endl;
  for (i = 0; i < min(n, x); i++) {
    cout << i + 1 << " " << 1 << endl;
  }
  long long j = 2;
  for (; i < n; i++) {
    cout << x << " " << j << endl;
    j++;
  }
  return 0;
}
