#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, even, odd, i, j;
  cin >> n;
  if (n == 1) {
    cout << "0";
    return 0;
  }
  if (n % 2 == 0) {
    even = n / 2;
    odd = n / 2;
  } else {
    even = n / 2;
    odd = n / 2 + 1;
  }
  cout << even * odd << endl;
  for (i = 1; i <= n; i += 2) {
    for (j = 2; j <= n; j += 2) {
      cout << i << " " << j << endl;
    }
  }
  return 0;
}
