#include <bits/stdc++.h>
using namespace std;
long long n;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  if (n == 1) {
    cout << 0 << '\n';
  } else {
    cout << ((n + 1) / 2) * (n / 2) << '\n';
    for (int i = 1; i <= n; i += 2) {
      for (int j = 2; j <= n; j += 2) {
        cout << i << " " << j << '\n';
      }
    }
  }
}
