1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include <iostream>
#include <math.h>

int main(){
	unsigned long long n,q,wynik;
	wynik = 0;
	std::cin >> n;
	for ( unsigned long long i = 0; i < n; i++ ){
		std::cin >> q;
		wynik = wynik + pow(2, q);
	//	std::cout << q << " ; " << wynik << " ; " << ( 2 ^ q) << std::endl;
	}
	unsigned long long i = 0;
	q = 1;
	
	while ( q < wynik){
		i = i + 1;
		q = q + q;
	}
	
	std::cout << i - 1 << std::endl;
	
	//std::cout << ( 2 ^ 3) << std::endl;
	
	
	return 0;
}