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