#include<bits/stdc++.h>
#define rep(i,n)for(int i=0;i<n;i++)
using namespace std;
typedef long long ll;

int main() {
	ll n;
	while (scanf("%lld", &n), n) {
		ll sum = 0;
		rep(i, n) {
			ll x, y, h, w; scanf("%lld%lld%lld%lld", &x, &y, &h, &w);
			x += y + h;
			if (x <= 60 && w <= 2)sum += 600;
			else if (x <= 80 && w <= 5)sum += 800;
			else if (x <= 100 && w <= 10)sum += 1000;
			else if (x <= 120 && w <= 15)sum += 1200;
			else if (x <= 140 && w <= 20)sum += 1400;
			else if (x <= 160 && w <= 25)sum += 1600;
		}
		printf("%lld\n", sum);
	}
}