/*
	0160:Delivery Fee
*/

#include	<iostream>

using namespace std;

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