#include<stdio.h>

int main(){

int b,r,g,c,s,t,S=0;
while(1){

scanf("%d %d %d %d %d %d",&b,&r,&g,&c,&s,&t);
if(b==r==g==c==s==t)break;
S=100;


//g=g-b*5-r*3;
S+=g*7+c*2+b*15+r*15;
S+=b*5*16+r*3*16;
t=t-s;
S-=t*3;

printf("%d\n",S);
}
return 0;
}