function main (input) {
    var n = input.split('\n')[0];
    var a = input.split('\n')[1].split(' ');
    var flg = true;
    var cnt = 0;

    while (flg) {
        for (var i = 0; i < n; i++) {
            if (a[i] % 2 === 0) {
                flg = false;
            }
            cnt ++;
        }
    }
    console.log(cnt);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));