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 C# (Mono 4.6.2.0) (judge verdict: Accepted)

using System.Collections.Generic;
using System.IO;
using System.Linq;

using static System.Console;

/// <summary>
/// AtCoder を解く上でのテンプレートプロジェクト
/// </summary>
namespace AtCoderTemplete
{
	class Program
	{
		static void Main(string[] args) =>
			new Program().Solve(new ConsoleInput(In, ' '));

		public void Solve(ConsoleInput cin)
		{
            // 変数の宣言
            int i = 0;      // ループ制御用変数の宣言
            int ret = 0;    // 結果記録用の変数
            bool flagAllEven = true;    // 全て偶数か判定するフラグ

            // 整数の数を取得
            int num = int.Parse(System.Console.ReadLine());

            // 整数を取得
            string[] stringArray = System.Console.ReadLine().Split(' ');
            // 文字列から数字に変換
            int[] array = new int[num];

            for(i = 0; i < num; i++)
            {
                array[i] = int.Parse(stringArray[i]);
            }

            // 全て偶数なら2で割る処理を行う
            // 全て偶数の場合実行
            while(flagAllEven)
            {
                for(i = 0; i < num; i++)
                {
                    // 偶数の時は2で割る
                    if (array[i] % 2 == 0)
                    {
                        array[i] = array[i] / 2;
                    }
                    // 奇数の時はフラグをfalseにし、終了
                    else
                    {
                        flagAllEven = false;
                        break;
                    }
                }

                // 全て偶数だった場合は、結果を1増やす
                if (flagAllEven)
                {
                    ret++;
                }
            }

            System.Console.WriteLine(ret.ToString());
		}
	}

	/// <summary>
	/// 汎用入力を提供するクラス
	/// </summary>
	public class ConsoleInput
	{
		#region Readonly Field

		/// <summary>
		/// テキスト読み込み用 Stream
		/// </summary>
		private readonly TextReader _stream;

		/// <summary>
		/// 区切り文字
		/// </summary>
		private readonly char _separator = ' ';

		#endregion Readonly Field

		#region Properties

		/// <summary>
		/// ストリーム取得用キュー
		/// </summary>
		private Queue<string> _InputStream { get; set; } = new Queue<string>();

		/// <summary>
		/// データ読み込みプロパティ
		/// </summary>
		public string Read
		{
			get
			{
				if (_InputStream.Count != 0)
					return _InputStream.Dequeue();

				var tmp = _stream.ReadLine().Split(_separator);

				for (int i = 0; i < tmp.Length; ++i)
					_InputStream.Enqueue(tmp[i]);

				return _InputStream.Dequeue();
			}
		}

		/// <summary>
		/// データ読み込み
		/// </summary>
		public string ReadLine { get { return _stream.ReadLine(); } }

		/// <summary>
		/// データ読み込み(int)
		/// </summary>
		public int ReadInt { get { return int.Parse(Read); } }

		/// <summary>
		/// データ読み込み(long)
		/// </summary>
		public long ReadLong { get { return long.Parse(Read); } }

		/// <summary>
		/// データ読み込み(double)
		/// </summary>
		public double ReadDouble { get { return double.Parse(Read); } }

		#endregion Properties

		#region Constructor

		/// <summary>
		/// コンストラクタ
		/// </summary>
		/// <param name="stream"> 入力テキストデータ </param>
		/// <param name="separator"> 区切り文字 </param>
		public ConsoleInput(TextReader stream, char separator = ' ')
		{
			this._separator = separator;
			this._stream = stream;
		}

		#endregion Constructor

		#region Public Methods

		/// <summary>
		/// 型：string[] 読み込み用メソッド
		/// </summary>
		/// <param name="N"> read 長</param>
		/// <returns> 読み込んだデータ配列 </returns>
		public string[] ReadStrArray(long N) 
		{ 
			var ret = new string[N];

			for (long i = 0; i < N; ++i) 
				ret[i] = Read;
			
			return ret; 
		}

		/// <summary>
		/// 型：int[] 読み込み用メソッド
		/// </summary>
		/// <param name="N"> read 長</param>
		/// <returns> 読み込んだデータ配列 </returns>
		public int[] ReadIntArray(long N) 
		{ 
			var ret = new int[N]; 
			
			for (long i = 0; i < N; ++i) 
				ret[i] = ReadInt;
				
			return ret; 
		}

		/// <summary>
		/// 型：long[] 読み込み用メソッド
		/// </summary>
		/// <param name="N"> read 長</param>
		/// <returns> 読み込んだデータ配列 </returns>
		public long[] ReadLongArray(long N) 
		{ 
			var ret = new long[N];
			
			for (long i = 0; i < N; ++i) 
				ret[i] = ReadLong; 
				
			return ret; 
		}

		/// <summary>
		/// 型：double[] 読み込み用メソッド
		/// </summary>
		/// <param name="N"> read 長</param>
		/// <returns> 読み込んだデータ配列 </returns>
		public double[] ReadDoubleArray(long N)
		{
			var ret = new double[N];

			for (long i = 0; i < N; ++i)
				ret[i] = ReadDouble;

			return ret;
		}

		#endregion Public Methods
	}
}