#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  int n, m = 1;
  cin >> n;
  multimap<int, int> mp;
  for (int i = 1; i < n; i++) {
    for (int j = m + 1; j <= n; j += 2) mp.insert({i, j});
    m++;
  }
  cout << ((int)((mp).size())) << endl;
  for (auto m : mp) cout << m.first << " " << m.second << endl;
  return 0;
}
