#include<cstdio>
using namespace std;
#define rep(i,j) for(int i=0;i<j;i++)
int main(){
    int n;
    while(scanf("%d",&n),n){
        int ans = 0;
        rep(i,n){
            int x,y,h,w;
            scanf("%d%d%d%d",&x,&y,&h,&w);
            int size = x+y+h;
            (size<=60&&w<=2) ? ans+=600 : (size<=80&&w<=5) ? ans+=800 : (size<=100&&w<=10) ? ans+=1000 : (size<=120&&w<=15) ? ans+=1200 : (size<=140&&w<=20) ? ans+=1400 : (size<=160&&w<=25) ? ans+=1600 :ans+=0;
        }
        printf("%d\n",ans);
    }
    return 0;
}