#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  cin >> n;
  int adj[101][101];
  memset(adj, 0, sizeof(adj));
  for (int i = 2; i <= n; i++) {
    vector<int> v;
    for (int j = i - 1; j >= 1; j--) {
      int u = 0;
      for (int k = 0; k < v.size(); k++) {
        if (adj[v[k]][j] == 1) {
          u = 1;
          break;
        }
      }
      if (u == 0) {
        adj[i][j] = adj[j][i] = 1;
        v.push_back(j);
      }
    }
  }
  int cnt = 0;
  vector<pair<long long int, long long int> > ans;
  for (int i = 1; i <= n; i++) {
    for (int j = i + 1; j <= n; j++) {
      if (adj[i][j] == 1) {
        cnt++;
        ans.push_back(make_pair(i, j));
      }
    }
  }
  cout << cnt << endl;
  for (int i = 0; i < ans.size(); i++) {
    cout << ans[i].first << " " << ans[i].second << endl;
  }
  return 0;
}
