#include<iostream>
using namespace std;
int main(){
	const int sizes[] = {60,80,100,120,140,160};
	const int weights[] = {2,5,10,15,20,25};
	const int fee[] = {600,800,1000,1200,1400,1600};
	while(true){
		long long int ans=0;
		int n;
		scanf("%d", &n);
		if( n == 0 )
			break;
		for(int i = 0; i < n; ++i){
			int x,y,h,w;
			int size;
			scanf("%d%d%d%d", &x, &y, &h, &w);
			size = x + y + h;
			for(int k = 0; k < sizeof(sizes)/sizeof(*sizes); ++k){
				if( size <= sizes[k] && w <= weights[k] ){
					ans += fee[k];
					break;
				}
			}
		}
		printf("%lld\n", ans);
	}
}