#include <bits/stdc++.h>
using namespace std;
void setIO(const string &name = "") {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  if (name.length()) {
    freopen((name + ".in").c_str(), "r", stdin);
    freopen((name + ".out").c_str(), "w", stdout);
  }
}
template <typename T>
void read(vector<T> &a) {
  for (auto &x : a) cin >> x;
}
template <typename T>
void read(vector<T> &a, long long n) {
  a.resize(n);
  for (auto &x : a) cin >> x;
}
template <typename T>
void print(vector<T> &a) {
  for (const auto &x : a) cout << x << ' ';
  cout << '\n';
}
void MOD(long long &x) {
  x %= 1000000007;
  if (x < 0) x += 1000000007;
}
long long gcd(long long a, long long b) { return !a ? b : gcd(b % a, a); }
int32_t main() {
  setIO();
  long long n;
  cin >> n;
  if (n == 1) {
    cout << "0\n";
    return 0;
  } else if (n == 2) {
    cout << "1\n1 2\n";
    return 0;
  } else if (n == 3) {
    cout << "2\n1 2\n1 3\n";
    return 0;
  }
  long long ans = 4;
  for (auto(i) = 5; i < n + 1; i++) ans += (i) / 2;
  cout << ans << '\n';
  for (long long i = 1; i <= n; i += 2) {
    for (long long j = 2; j <= n; j += 2) {
      cout << i << ' ' << j << '\n';
    }
  }
  return 0;
}
