#include <bits/stdc++.h>
using namespace std;
long long int em(long long int x, long long int Mod, long long int n) {
  if (n == 0)
    return 1ll;
  else if (n % 2 == 0)
    return em((x % Mod * x % Mod) % Mod, Mod, n / 2) % Mod;
  else
    return (x % Mod * em((x % Mod * x % Mod) % Mod, Mod, (n - 1) / 2)) % Mod;
}
int32_t main() {
  std::ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int n, y, z, x, i, j, k;
  cin >> n;
  x = 1, y = 1;
  vector<pair<long long int, long long int> > ans;
  long long int co = 0;
  while (co != n) {
    ans.push_back({x, y});
    co++;
    if (co % 2 != 0)
      x++;
    else
      y++;
  }
  if (co % 2 != 0)
    x--;
  else
    y--;
  cout << max(x, y) << "\n";
  for (pair<long long int, long long int> v : ans)
    cout << v.first << " " << v.second << "\n";
}
