#include <iostream>
using namespace std;

int main(){
	long long int x,y,h,w,n,i,price;
	while(cin >> n && n){
		price = 0;
		for(i=0;i<n;i++){
			cin >> x >> y >> h >> w;
			if(x+y+h<=60&&w<=2) price += 600;
			else if(x+y+h<=80&&w<=5) price += 800;
			else if(x+y+h<=100&&w<=10) price += 1000;
			else if(x+y+h<=120&&w<=15) price += 1200;
			else if(x+y+h<=140&&w<=20) price += 1400;
			else if(x+y+h<=160&&w<=25) price += 1600;
		}
		cout << price << endl;
	}
	return 0;
}