#include <bits/stdc++.h>
using namespace std;
void RD(int &x) { scanf("%d", &x); }
void RD(long long &x) { scanf("%I64d", &x); }
void RD(unsigned int &x) { scanf("%u", &x); }
void RD(double &x) { scanf("%lf", &x); }
void RD(int &x, int &y) { scanf("d", &x, &y); }
void RD(long long &x, long long &y) { scanf("I64d", &x, &y); }
void RD(unsigned int &x, unsigned int &y) { scanf("u", &x, &y); }
void RD(double &x, double &y) { scanf("lf", &x, &y); }
void RD(int &x, int &y, int &z) { scanf("d%d", &x, &y, &z); }
void RD(long long &x, long long &y, long long &z) {
  scanf("I64d%I64d", &x, &y, &z);
}
void RD(unsigned int &x, unsigned int &y, unsigned int &z) {
  scanf("u%u", &x, &y, &z);
}
void RD(double &x, double &y, double &z) { scanf("lf%lf", &x, &y, &z); }
void RD(char &x) { x = getchar(); }
void RD(char *s) { scanf("%s", s); }
void RD(string &s) { cin >> s; }
void PR(int x) { printf("%d\n", x); }
void PR(long long x) { printf("%I64d\n", x); }
void PR(unsigned int x) { printf("%u\n", x); }
void PR(double x) { printf("%.6lf\n", x); }
void PR(char x) { printf("%c\n", x); }
void PR(char *x) { printf("%s\n", x); }
void PR(string x) { cout << x << endl; }
bool mp[205][205];
int f[205];
void init() {
  f[0] = 0;
  int tmp;
  tmp = 1;
  for (int i = 1; i <= 105; i += 2) {
    f[i] = tmp;
    f[i + 1] = tmp;
    tmp = tmp + 1;
  }
}
int n;
int main() {
  init();
  while (scanf("%d", &n) != EOF) {
    int ans;
    ans = 0;
    for (int i = 0; i <= n - 1; i++) {
      ans += f[i];
    }
    printf("%d\n", ans);
    memset(mp, 0, sizeof(mp));
    bool flag;
    for (int i = 1; i <= n; i++) {
      for (int j = i - 1; j >= 1; j--) {
        flag = true;
        for (int k = 1; k <= n; k++)
          if (k != i && k != j) {
            if (mp[i][k] && mp[k][j]) {
              flag = false;
              break;
            }
          }
        if (flag) {
          mp[i][j] = 1;
          mp[j][i] = 1;
          printf("%d %d\n", i, j);
        }
      }
    }
  }
  return 0;
}
