PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN

#GL0000002. Chia đôi đồng thời (Shift only)

HỌC THEO LỘ TRÌNH

Bài tập thuộc lộ trình

1 lộ trình

Chia đôi đồng thời (Shift only)

Shift only

Source: AtCoder

Version: Phuoc Hung OJ Extended

Problem Statement

A blackboard contains NN positive integers A1,…,ANA_1,\ldots,A_N. An operation is allowed only when every number is even. The operation divides all numbers by 22 simultaneously. Find the maximum number of such operations.

Input

The first line contains NN; the second contains the NN integers AiA_i.

Output

Print the maximum number of operations.

Subtasks

  • Subtask 1 (20 points): 1≤N≤51 \le N \le 5; 1≤Ai≤1001 \le A_i \le 100
  • Subtask 2 (30 points): 1≤N≤501 \le N \le 50; 1≤Ai≤1061 \le A_i \le 10^{6}
  • Subtask 3 (50 points): 1≤N≤2001 \le N \le 200; 1≤Ai≤1091 \le A_i \le 10^{9}

Examples

Input

3
8 12 40

Output

2

Explanation

After two operations the array becomes [2,3,10][2,3,10]. Since 33 is odd, no third operation is possible.