#include <cstdio>
#include <cmath>

using namespace std;

int g[20];
int tsol, sol;

int main( void ) {

	for( int i = 0; i < 10; ++i ) {
		scanf( "%d", &g[i] );
		tsol += g[i];
		if( abs( tsol - 100. ) < abs( sol - 100. ) ) sol = tsol;
		if( abs( tsol - 100. ) == abs( sol - 100. ) && tsol > sol ) sol = tsol;
	}
	
	printf( "%d\n", sol );

    return 0;
}
