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