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