#include<iostream>
using namespace std;
int main(void){
    while(true){
        int ans=0,n;
        cin >> n;
        if(n==0)                        break;
        for(int i=0;i<n;i++){
            int x,y,h,w;
            cin >> x >> y >> h >> w;
            int s=x+y+h;
            if(s<=60 && w<=2)           ans+=600;
            else if(s<=80 && w<=5)      ans+=800;
            else if(s<=100 && w<=10)    ans+=1000;
            else if(s<=120 && w<=15)    ans+=1200;
            else if(s<=140 && w<=20)    ans+=1400;
            else if(s<=160 && w<=25)    ans+=1600;
        }
        cout << ans << endl;
    }
}
