#include <iostream>
using namespace std;

int solver(int d, int w){
    if(d > 160 || w > 25)
        return 0;
    else if(d > 140 || w > 20)
        return 1600;
    else if(d > 120 || w > 15)
        return 1400;
    else if(d > 100 || w > 10)
        return 1200;
    else if(d > 80 || w > 5)
        return 1000;
    else if(d > 60 || w > 2)
        return 800;
    else
        return 600;
}

int main(){
    int n;
    while(cin >> n, n!=0){
        int sum = 0;
        for(int i=0; i<n; i++){
            int x,y,h,w;
            cin >> x >> y >> h >> w;
            sum += solver(x+y+h, w);
        }
        cout << sum << endl;
    }
    return 0;
}