#include <iostream>
#include <cstdio>
using namespace std;
int a[13];
int main() {
for (int i = 1; i <= 12; i++) {
cin >> a[i];
}
int money[13], sum;
money[1] = 300 - a[1];
sum = (money[1] / 100) * 100;
for (int i = 2; i <= 12; i++) {
money[i] = (money[i-1] % 100) + 300 - a[i];
sum += (money[i] / 100) * 100;
if (money[i] < 0) {
cout << "-" << i << endl;
return 0;
}
}
cout << sum*6/5 << endl;
return 0;
}