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

signed main()
{
	int n;
	int x, y, h, w;

	while (true)
	{
		cin >> n;
		if (n == 0) break;
		int ans = 0;
		rep(i,n)
		{
			cin >> x >> y >> h >> w;
			int len = x + y + h;

			if (len <= 60 && w <= 2)
			{
				ans += 600;
			}
			else if (len <= 80 && w <= 5)
			{
				ans += 800;
			}
			else if (len <= 100 && w <= 10)
			{
				ans += 1000;
			}
			else if (len <= 120 && w <= 15)
			{
				ans += 1200;
			}
			else if (len <= 140 && w <= 20)
			{
				ans += 1400;
			}
			else if (len <= 160 && w <= 25)
			{
				ans += 1600;
			}
		}

		printf("%d\n", ans);
	}
}