#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
const int mod = 1e9 + 7;
int a[2000][2000];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  int cnt = 1;
  int x = 1, y = 1;
  while (cnt <= 1000) {
    a[x][y] = cnt;
    a[x][y + 1] = cnt + 1;
    x++;
    y++;
    cnt += 2;
  }
  for (int i = 1; i <= 1000; i++) {
    for (int j = 1; j <= 1000; j++) {
      if (a[i][j] == n) {
        x = i;
        y = j;
        break;
      }
    }
  }
  cout << max(x, y) << endl;
  for (int i = 1; i <= x; i++) {
    for (int j = 1; j <= y; j++) {
      if (a[i][j] > 0 && a[i][j] <= n) cout << i << " " << j << "\n";
    }
  }
  return 0;
}
