#include<iostream>
using namespace std;
int b,r,g,c,s,t,ans;
int main(){
  while(1){
    cin>>b>>r>>g>>c>>s>>t;
    if(b==0&&r==0&&g==0&&c==0&&s==0&&t==0)break;
    ans=100;
    ans-=t*3;
    ans+=(b*(15*6+5)+r*(15*4+3)+g*7+c*2+3*s);
    cout<<ans<<endl;
  }
  return 0;
}