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