#include <bits/stdc++.h>
using namespace std;
long long poow(long long n, long long k) {
  if (k == 0) return 1;
  long long mul = poow(n, k / 2) % 998244353;
  if (k % 2 == 0)
    return (mul * mul) % 998244353;
  else
    return ((mul * mul) % 998244353 * n % 998244353) % 998244353;
}
int main() {
  int n;
  cin >> n;
  vector<int> v1, v2;
  int i = 0;
  for (i = 1; i <= n / 2; i++) v1.push_back(i);
  for (; i <= n; i++) v2.push_back(i);
  cout << v1.size() * v2.size() << endl;
  for (int i = 0; i < v1.size(); i++)
    for (int j = 0; j < v2.size(); j++) cout << v1[i] << " " << v2[j] << endl;
}
