#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

int main() {
  while(true) {
    int n;
    cin >> n;
    if(n == 0) break;
    int result = 0;
    for(int i = 0; i < n; ++i) {
      int x, y, h, weight;
      cin >> x >> y >> h >> weight;
      int size;
      size = x + y + h;
      vector<int> resultCandidits(2);
      resultCandidits[0] = (
          (size <= 60) ? 0 :
          (size <= 80) ? 1 :
          (size <= 100) ? 2 :
          (size <= 120) ? 3 :
          (size <= 140) ? 4 :
          (size <= 160) ? 5 :
          6
      );
      resultCandidits[1] = (
          (weight <= 2) ? 0 :
          (weight <= 5) ? 1 :
          (weight <= 10) ? 2 :
          (weight <= 15) ? 3 :
          (weight <= 20) ? 4 :
          (weight <= 25) ? 5 :
          6
      );
      int answers[] = {600, 800, 1000, 1200, 1400, 1600, 0};
      result += answers[max(resultCandidits[0], resultCandidits[1])];
    }
    cout << result << endl;
  }
  return 0;
}