#include <bits/stdc++.h>
using namespace std;
const int N = 500023;
bool vis[N];
vector<int> adj[N];
void solve() {
  long long int n;
  cin >> n;
  vector<long long int> first, second;
  for (int i = 1; i <= n; i++) {
    if (i <= n / 2)
      first.push_back(i);
    else
      second.push_back(i);
  }
  cout << first.size() * second.size() << '\n';
  for (int i : first) {
    for (int j : second) {
      cout << i << ' ' << j << '\n';
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int T = 1;
  int t = 0;
  while (t++ < T) {
    solve();
  }
}
