#include <iostream>
#include <algorithm>
using namespace std;

int f(int size){
	if( size <= 60 )
		return 600;
	else if( size <= 80 )
		return 800;
	else if( size <= 100 )
		return 1000;
	else if( size <= 120 )
		return 1200;
	else if( size <= 140 )
		return 1400;
	else if( size <= 160 )
		return 1600;
	
	return 0;
}

int g(int w){
	if( w <= 2 )
		return 600;
	else if( w <= 5 )
		return 800;
	else if( w <= 10 )
		return 1000;
	else if( w <= 15 )
		return 1200;
	else if( w <= 20 )
		return 1400;
	else if( w <= 25 )
		return 1600;

	return 0;
}

int main(){
	int n;
	while( cin >> n , n ){
		int x,y,h,w,sum=0;

		for(int i=0 ; i < n ; i++ ){
			cin >> x >> y >> h >> w;
			int size = x+y+h;
			if( f(size) && g(w) ){
				sum += max( f(size) , g(w) );
			}
		}
		cout << sum << endl;
	}
}