#include <iostream>
using namespace std;

int main(void)
{
	int n;
	while (cin >> n, n){
		int x, y, h, w;
		int ret = 0;
		for (int i = 0; i < n; ++i)
		{
			cin >> x >> y >> h >> w;
			int max_type = 0, sum = x + y + h;
			if (sum <= 60) max_type = 1;
			else if (sum <= 80) max_type = 2;
			else if (sum <= 100) max_type = 3;
			else if (sum <= 120) max_type = 4;
			else if (sum <= 140) max_type = 5;
			else if (sum <= 160) max_type = 6;
			else max_type = 7;

			if (w <= 2) max_type = max(max_type, 1);
			else if (w <= 5) max_type = max(max_type, 2);
			else if (w <= 10) max_type = max(max_type, 3);
			else if (w <= 15) max_type = max(max_type, 4);
			else if (w <= 20) max_type = max(max_type, 5);
			else if (w <= 25) max_type = max(max_type, 6);
			else max_type = 7;

			if (max_type == 1) ret += 600;
			else if (max_type == 2) ret += 800;
			else if (max_type == 3) ret += 1000;
			else if (max_type == 4) ret += 1200;
			else if (max_type == 5) ret += 1400;
			else if (max_type == 6) ret += 1600;
		}

		cout << ret << endl;
	}

	return 0;
}