#include <stdio.h>

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