#include <iostream>
using namespace std;

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