#include<stdio.h>
int main(void)
{
	int n;
	int i;
	int x,y,h,w,s;
	int sum;
	
	scanf("%d",&n);
	while(n!=0){
		sum=0;
		for(i=0;i<n;i++){
			scanf("%d %d %d %d",&x,&y,&h,&w);
			s=x+y+h;
			if(s<=60 && w<=2){
				sum+=600;
			}
			else if(s<=80 && w<=5){
				sum+=800;
			}
			else if(s<=100 && w<=10){
				sum+=1000;
			}
			else if(s<=120 && w<=15){
				sum+=1200;
			}
			else if(s<=140 && w<=20){
				sum+=1400;
			}
			else if(s<=160 && w<=25){
				sum+=1600;
			}
		}
		printf("%d\n",sum);
		scanf("%d",&n);
	}
	return 0;
}