#include <bits/stdc++.h>
using namespace std;
long long int a, b, c, d, n, m, k, l, cnt = 0;
vector<int> v[2];
int main() {
  cin >> a;
  b = a * a;
  b /= 4;
  cout << b << endl;
  for (int i = 0; i < a; i++) {
    for (int j = 0; j < v[cnt].size(); j++)
      cout << i + 1 << " " << v[cnt][j] << "\n";
    cnt = 1 - cnt;
    v[cnt].push_back(i + 1);
  }
  return 0;
}
