#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int sz = 1e6 + 100;
const ll mod = 1e9 + 7;
int n, m;
int mat[105][105];
int main() {
  while (cin >> n) {
    m = 0;
    memset(mat, 0, sizeof mat);
    for (int i = 0; i < n; i++) {
      for (int j = i + 1; j < n; j++) {
        if (i % 2 != j % 2) {
          mat[i][j] = 1;
          mat[j][i] = 1;
          m++;
        }
      }
    }
    cout << m << "\n";
    for (int i = 0; i < n; i++) {
      for (int j = i + 1; j < n; j++) {
        if (mat[i][j]) cout << i + 1 << " " << j + 1 << "\n";
      }
    }
    cerr << "-----------\n";
  }
  return 0;
}
