#include <iostream>

using namespace std;

int main(){
  int b, r, g, c, s, t;
  while(1){
    cin >> b >> r >> g >> c >> s >> t;
    if(b==0 && r==0 && g==0 && c==0 && s==0 && t==0) break;

    int sum=0;

    t-=s;
    int bo=b*5+r*3;
    t-=bo;
    sum-=t*3;
    sum-=bo*2;
    sum+=bo*15;
    sum+=b*15+r*15+g*7+c*2+100;

    cout << sum << endl;
  }
  return 0;
}