#include <bits/stdc++.h>
using namespace std;
const int N = 100 + 3;
int n;
void input() { cin >> n; }
void solve() {
  cout << (n / 2 + (n % 2)) * (n / 2) << endl;
  for (int i = 1; i <= n / 2; i++)
    for (int j = n / 2 + 1; j <= n; j++) cout << i << ' ' << j << endl;
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  input(), solve();
  return 0;
}
