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