#include <bits/stdc++.h>
using namespace std;
struct lyrics {
  string line1;
  string line2;
};
struct myp {
  int f;
  int s;
};
struct edges {
  int v;
  bool check1;
};
struct mypair {
  string f;
  string s;
};
int dx[5] = {-1, 0, 0, 1, 0};
int dy[5] = {0, 1, -1, 0, 0};
int countvowel[100007];
bool isvowel[29];
long long gcd(long long a, long long b) {
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}
bool sorting(myp a, myp b) { return a.f < b.f; };
bool isok(int n, int m, int x, int y, char** a) {
  if (x >= 0 && x < n && y >= 0 && y < m) {
    return true;
    return false;
  }
  return false;
}
int gcd(int num, int denum) {
  if (num == 0)
    return denum;
  else
    return gcd(denum % num, num);
}
int get(long long x, int& finalzero) {
  int len = 0;
  while (x != 0) {
    len += 1;
    if (x % 2 == 0) {
      if (len <= 30) finalzero = len;
    }
    x /= 2;
  }
  return len;
}
int myabs(int a) {
  if (a >= 0)
    return a;
  else
    return -a;
}
int main() {
  int n;
  cin >> n;
  if (n == 1) {
    cout << "1" << endl;
    cout << "1 1" << endl;
    return 0;
  }
  int m = n / 2 + 1;
  cout << m << endl;
  int count = 0;
  for (int i = 0; i < m; i++) {
    cout << "1 " << i + 1 << endl;
    count += 1;
  }
  for (int i = 1; i < m; i++) {
    if (count == n) break;
    cout << i + 1 << " " << m << endl;
    count += 1;
  }
}
