#include <bits/stdc++.h>

using namespace std;

int main(void) {
  int n;
  while (cin >> n, n) {
    int x, y, h, w, l;
    int ans = 0;
    for (int i = 0; i < n; i++) {
      cin >> x >> y >> h >> w;
      l = x + y + h;

      if (l <= 60 && w <= 2) ans += 600;
      else if (l <= 80 && w <= 5) ans += 800;
      else if (l <= 100 && w <= 10) ans += 1000;
      else if (l <= 120 && w <= 15) ans += 1200;
      else if (l <= 140 && w <= 20) ans += 1400;
      else if (l <= 160 && w <= 25) ans += 1600;
    }

    cout << ans << endl;
  }

  return 0;
}
