#include <iostream>
#include <vector>
#include <algorithm>

#define REP(i,k,n) for(int i=k;i<n;i++)
#define rep(i,n) for(int i=0;i<n;i++)

using namespace std;

int main()
{
	int n;
	while(cin >> n && n)
	{
		long long ans = 0;
		int x,y,h,w;

		rep(i,n)
		{
			cin >> x >> y >> h >> w;

			int a = x + y + h;
			
			if(a <= 60 && w <= 2) ans += 600;
			else if(a <= 80 && w <= 5) ans += 800;
			else if(a <= 100 && w <= 10) ans += 1000;
			else if(a <= 120 && w <= 15) ans += 1200;
			else if(a <= 140 && w <= 20) ans += 1400;
			else if(a <= 160 && w <= 25) ans += 1600;	
		}
		cout << ans << endl;
	}
	return 0;
}