const lines = require('fs') .readFileSync('/dev/stdin', 'utf-8') .trim().split('\n').values(); const N = Number(lines.next().value); const a = lines.next().value.split(' ').map(x => Number(x)); const max = Math.max(...a); let 鶴 = a.reduce((a, x) => a + (x === max ? 1 : 0), 0); let 亀 = N - 鶴; if (鶴 * 2 + 亀 * 4 !== max + 2) { [鶴, 亀] = [亀, 鶴]; } console.log(鶴, 亀);