#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
int main(){
  int b, r, g, c, s, t;
  while(cin >> b >> r >> g >> c >> s >> t){
    if(b == 0 && r == 0 && g == 0 && c == 0 && s == 0 && t == 0) break;
    int m = 100;
    m -= t * 3;
    m += s * 3;
    m += c * 2;
    m += b * 15;
    m += (b*5) * 15 + (b*5);
    m += r * 15;
    m += (r*3) * 15 + (r*3);
    m += g * 7;

    cout << m << endl;
  }
  return 0;
}

    