#include <bits/stdc++.h>
using namespace std;
long long min(long long x, long long y) { return (x < y) ? x : y; }
long long max(long long x, long long y) { return (x > y) ? x : y; }
const int N = 100009;
int x, y, n, m, i, u, w, z, sum, best, j, k, t, mx;
int a[N];
string s, ans;
int main() {
  cin >> n;
  cout << (n / 2) * ((n + 1) / 2) << endl;
  for (i = 0; i < n; i += 2)
    for (j = 1; j < n; j += 2) cout << i + 1 << ' ' << j + 1 << endl;
}
