#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
vector<pair<int, int> > edge;
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int n;
  cin >> n;
  for (int i = 1; i < n; i += 2)
    for (int j = 1; j + i <= n; ++j) edge.push_back(make_pair(j, i + j));
  cout << edge.size() << "\n";
  for (auto i : edge) cout << i.first << " " << i.second << "\n";
}
