#include using namespace std; typedef long long ll; int main() { ll n; cin >> n; vector> G(n, vector (n)); int nodes = 0; for(int i = 0; i < n; i++){ for(int j = i + 1; j < n - i; j++){ G[i][j] = 1; nodes++; } } cout << nodes << endl; for(int i = 0; i < n; i++){ for(int j = i + 1; j < n; j++){ if(G[i][j]) cout << i + 1 << " " << j + 1 << endl; } } return 0; }