#include <bits/stdc++.h>
using namespace std;
const int N = 500010;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  vector<pair<int, int> > v;
  for (int i = 1; i <= n; i += 2) {
    for (int j = 1; j + i <= n; ++j) v.push_back({j, j + i});
  }
  cout << v.size() << endl;
  for (auto x : v) cout << x.first << " " << x.second << endl;
}
