#include <iostream>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <sstream>
#include <cmath>
#include <queue>

using namespace std;

int main(){
	
	int b, r, g, c, s, t;
	
	while(true){
		
		cin >> b >> r >> g >> c >> s >> t;
		
		if(t == 0){
			break;
		}
		
		int ans = 100;
		
		ans += b * (15 + 16 * 5);
		ans += r * (15 + 16 * 3);
		ans += g * 7;
		ans += c * 2;
		
		t -= s;
		
		ans -= t * 3;
		
		cout << ans << endl;
		
	}
	
	return 0;
}