#include<iostream>
#include<math.h>
#include<vector>
#include<algorithm>
#include<cstdio>
#include <string>
#include <complex>
using namespace std;

int main(){
    int n,i;
    while(cin>>n&&n){
        int x,y,h,w,b;
        int mo=0,big,wei,max;
        for(i=0;i<n;i++){
        cin>>x>>y>>h>>w;
        b=x+y+h;
        if(b<=60) big=1;
        else if(b<=80) big=2;
        else if(b<=100) big=3;
        else if(b<=120) big=4;
        else if(b<=140) big=5;
        else if(b<=160) big=6;
        else big=7;

        if(w<=2) wei=1;
        else if(w<=5) wei=2;
        else if(w<=10) wei=3;
        else if(w<=15) wei=4;
        else if(w<=20) wei=5;
        else if(w<=25) wei=6;
        else wei=7;

        if(big<=wei) max=wei;
        else max=big;
        switch(max){
            case 1:
            mo+=600;
            break;
            case 2:
            mo+=800;
            break;
            case 3:
            mo+=1000;
            break;
            case 4:
            mo+=1200;
            break;
            case 5:
            mo+=1400;
            break;
            case 6:
            mo+=1600;
            break;
            case 0:
            mo+=0;
            break;
            default:
            mo+=0;
            break;
        }
        }
        cout<<mo<<endl;
    }
    return 0;
}
