#include <iostream>

using namespace std;

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

int main()
{
	solve();
	return(0);
}