const main = input => {
  let [_, ...a] = input.trim().split(/\s|\n/).map(e => Number.parseInt(e))
  let i = 0
  while(a.findIndex((e, i, s) => [s[i] /= 2, e % 2 > 0][1]) < 0) i++
  return i
}; // Implement this function

console.log(main(require('fs').readFileSync('/dev/stdin', 'utf8'))); // Common part