#include <bits/stdc++.h>
using namespace std;
long ar[] = {150, 300, 450, 600, 750};
int point[] = {500, 1000, 1500, 2000, 2500};
int main() {
  int time;
  long res = 0, a, b, c;
  for (int i = 0; i < 5; i++) {
    cin >> time;
    a = (250 - time);
    b = point[i] / 250;
    c = a * b;
    res += max(ar[i], c);
  }
  int w, wrong = 0;
  for (int i = 0; i < 5; i++) {
    cin >> w;
    wrong += w * 50;
  }
  cout << wrong << endl;
  int s, u;
  cin >> s >> u;
  s = s * 100;
  u = u * 50;
  cout << res + s - wrong - u << endl;
}
