Problem:
Score : 200 points

Problem Statement

There are N positive integers written on a blackboard: A_1, ..., A_N.

Snuke can perform the following operation when all integers on the blackboard are even:

Replace each integer X on the blackboard by X divided by 2.

Find the maximum possible number of operations that Snuke can perform.

Constraints

1 \leq N \leq 200

1 \leq A_i \leq 10^9

Input

Input is given from Standard Input in the following format:

N
A_1 A_2 ... A_N

Output

Print the maximum possible number of operations that Snuke can perform.

Sample Input 1

3
8 12 40

Sample Output 1

2

Initially, [8, 12, 40] are written on the blackboard.
Since all those integers are even, Snuke can perform the operation.

After the operation is performed once, [4, 6, 20] are written on the blackboard.
Since all those integers are again even, he can perform the operation.

After the operation is performed twice, [2, 3, 10] are written on the blackboard.
Now, there is an odd number 3 on the blackboard, so he cannot perform the operation any more.

Thus, Snuke can perform the operation at most twice.

Sample Input 2

4
5 6 8 10

Sample Output 2

0

Since there is an odd number 5 on the blackboard already in the beginning, Snuke cannot perform the operation at all.

Sample Input 3

6
382253568 723152896 37802240 379425024 404894720 471526144

Sample Output 3

8

Solution in Rust (1.42.0) (judge verdict: Accepted)

use std::io::{stderr, stdin, stdout, BufReader, BufWriter, Cursor, Read, Write};
use std::iter::Iterator;
use std::str::FromStr;
// use std::slice::Iter;

macro_rules! _ft { () => (impl FnOnce(&mut Cursor<Vec<u8>>, &mut Vec<u8>, &mut Vec<u8>)); }

#[allow(dead_code)]
fn main() {
  let stdin = stdin();
  let r = &mut BufReader::new(stdin.lock());
  let stdout = stdout();
  let w = &mut BufWriter::new(stdout.lock());
  let stderr = stderr();
  let err = &mut BufWriter::new(stderr.lock());
  run(r, w, err);
  w.flush().unwrap();
  err.flush().unwrap();
}

#[allow(dead_code)]
fn test(input: &str, output: &str, f: _ft!()) {
  let r = &mut Cursor::new(input.as_bytes().to_vec());
  let w: &mut Vec<u8> = &mut Vec::new();
  let err: &mut Vec<u8> = &mut Vec::new();
  f(r, w, err);
  writeln!(stderr(), "{}", String::from_utf8(err.to_vec()).unwrap()).unwrap();
  assert_eq!(String::from_utf8(w.to_vec()).unwrap(), output)
}

macro_rules! t {
  ($f: ident => $input: expr, $output: expr) => (
    #[test]
    fn $f() { test($input, $output, run); }
  );
}

#[allow(unused_macros)]
macro_rules! args {
  ($($arg: expr),*) => ({
    let mut s = String::new();
    $(s += &format!("{} ", $arg);)*
    s.pop().unwrap();
    s
  });
}

#[allow(dead_code)]
fn read<F: FromStr, R: Read>(reader: &mut R) -> F {
  let str = reader
    .by_ref()
    .bytes()
    .map(|c| c.unwrap() as char)
    .skip_while(|c| c.is_whitespace())
    .take_while(|c| !c.is_whitespace())
    .collect::<String>();
  str.parse::<F>().ok().unwrap()
}

#[allow(unused_macros)]
macro_rules! r {
  ($stream: expr) => (read::<String, _>($stream));
  ($stream: expr, ) => (r!($stream));
  ($stream: expr; ) => (r!($stream));
  ($stream: expr; $t: ty) => (read::<$t,  _>($stream));
  ($stream: expr; $($t: ty),*) => (($(r!($stream; $t)),*));
  ($stream: expr; $t: ty; $n: expr) => ((0..$n).map(|_| r!($stream; $t)).collect::<Vec<_>>());
}

macro_rules! _writes {
  ($stream: expr; $($arg: expr),*) => ({
    let mut f = false;
    $(
      if f { write!($stream, " ").ok(); } else { f = true; }
      write!($stream, "{}", $arg).ok();

    )*
  });
}

#[allow(unused_macros)]
macro_rules! w {
  ($stream: expr) => (write!($stream, " ").ok());
  ($stream: expr; ) => (w!($stream));
  ($stream: expr, ) => (w!($stream));
  ($stream: expr; $arg: expr) => (write!($stream, "{}", $arg).ok());
  ($stream: expr; $($arg: expr),*) => (_writes!($stream; $($arg),*));
  ($stream: expr, $($arg: tt)*) => (write!($stream, $($arg)*).ok());
}

#[allow(unused_macros)]
macro_rules! wl {
  ($stream: expr) => (writeln!($stream));
  ($stream: expr, ) => (wl!($stream));
  ($stream: expr; ) => (wl!($stream));
  ($stream: expr; $arg: expr) => (writeln!($stream, "{}", $arg));
  ($stream: expr; $($arg: expr),*) => (_writes!($stream; $($arg),*); wl!($stream));
  ($stream: expr, $($arg: tt)*) => (writeln!($stream, $($arg)*));
}

trait VecSelect<T> {
  fn select<U>(&self, f: impl FnMut(&T) -> U)  -> Vec<U>;
}

impl<T> VecSelect<T> for Vec<T> {
  fn select<U>(&self, mut f: impl FnMut(&T) -> U)  -> Vec<U> {
    self.iter().map(|i| f(i)).collect::<Vec<_>>()
  }
}

#[allow(unused_variables)]
fn run<R: Read, W: Write, E: Write>(r: &mut R, w: &mut W, err: &mut E) {
  let n = r!(r; i64);
  let a = r!(r; i64; n);
  let ans = a.iter().map(|i| i.trailing_zeros()).min().unwrap();
  w!(w; ans);
}

t!(tb1 => r"3
8 12 40", r"2");
t!(tb2 => r"4
5 6 8 10", r"0");
t!(tb3 => r"6
382253568 723152896 37802240 379425024 404894720 471526144", r"8");