#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>

using namespace std;

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