let input = require('fs').readFileSync('/dev/stdin', 'utf8'); const C1 = input.replace('?', '1').split(/\s/).map(v => Number(v)); C1.pop(); const C2 = input.replace('?', '4').split(/\s/).map(v => Number(v)); C2.pop(); const isC1 = C1[1] == Math.max(...C1) || C1[1] == Math.min(...C1); const isC2 = C2[1] == Math.max(...C2) || C2[1] == Math.min(...C2); console.log(isC1 && isC2 ? 14 : isC1 ? 1 : 4);