#include <bits/stdc++.h>
using namespace std;
const long long infl = 1e18 + 5;
long long int n, m, k, q, x, y, f, val, t = 1, i, j;
long long int ind = -1, cnt, sz, sm, ans, mx = -1, mn = infl;
long long int a[1000004];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  if (fopen("inp.txt", "r")) {
    freopen("myfile.txt", "w", stdout);
    freopen("inp.txt", "r", stdin);
  }
  cin >> n;
  m = (n + 1) / 2;
  cout << m * (n - m) << "\n";
  for (i = 1; i < m + 1; i++) {
    for (j = m + 1; j < n + 1; j++) cout << i << " " << j << "\n";
  }
  return 0;
}
