#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007LL;
const long long MAX = 100010LL;
template <typename T>
T gcd(T a, T b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
template <typename T>
T power(T x, T y, long long m = MOD) {
  T ans = 1;
  x %= m;
  while (y > 0) {
    if (y & 1LL) {
      ans = (ans * x) % m;
    }
    y >>= 1LL;
    x = (x * x) % m;
  }
  return (ans % m);
}
class BNauuoAndChess {
 public:
  void solve(std::istream& cin, std::ostream& cout) {
    int n;
    cin >> n;
    int m = ceil(1.0 * (n + 1) / 2);
    cout << m << endl;
    int row = 1, col = 1;
    for (int i = 0; i < n; i++) {
      cout << row << " " << col << endl;
      if (col < m) {
        col++;
      } else {
        row++;
      }
    }
  }
};
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  BNauuoAndChess solver;
  std::istream& in(std::cin);
  std::ostream& out(std::cout);
  solver.solve(in, out);
  return 0;
}
