#include <stdio.h>

int main(void)
{
	for(;;)
	{
		int x,y,h,w,z,n,m,ans=0;
		scanf("%d",&n);
		if(n==0)
		{
			break;
		}
		for(m=0;m<n;m++)
		{
			scanf("%d %d %d %d",&x,&y,&h,&w);
			z=x+y+h;
			if(z<=60&&w<=2)
			{
				ans+=600;
			}
			else if(z<=80&&w<=5)
			{
				ans+=800;
			}
			else if(z<=100&&w<=10)
			{
				ans+=1000;
			}
			else if(z<=120&&w<=15)
			{
				ans+=1200;
			}
			else if(z<=140&&w<=20)
			{
				ans+=1400;
			}
			else if(z<=160&&w<=25)
			{
				ans+=1600;
			}
		}
		printf("%d\n",ans);
	}
	return 0;
}