#include <bits/stdc++.h>
using namespace std;
int pa, pb;
int n;
inline void read(int &x) {
  int f = 1;
  char c;
  for (x = 0, c = getchar(); c < '0' || c > '9'; c = getchar())
    if (c == '-') f = -1;
  for (; c >= '0' && c <= '9'; c = getchar())
    x = (x << 1) + (x << 3) + (c ^ 48);
  x *= f;
}
inline int mx(int _x, int _y) { return _x > _y ? _x : _y; }
inline int mn(int _x, int _y) { return _x < _y ? _x : _y; }
int main() {
  read(n);
  pa = n >> 1;
  pb = n - pa;
  printf("%d\n", pa * pb);
  for (int i = 1; i <= pa; i++)
    for (int j = pa + 1; j <= n; j++) printf("%d %d\n", i, j);
  return 0;
}
