#include <cstdio>
#include <cstring>
#include <algorithm>
#include <string>
#include <cmath>
#include <stack>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <list>
#include <iostream>
#include <sstream>
#include <climits>
#include <cfloat>
#include <complex>


typedef long long ll;
const double Eps = 1e-4;
bool eq(double a, double b)
{
	return abs(a - b) < Eps;
}

using namespace std;

int main()
{
	int Size[] = { 60, 80, 100, 120, 140, 160, 100000 };
	int Weight[] = { 2, 5, 10, 15, 20, 25, 100000 };
	int Fee[] = { 600, 800, 1000, 1200, 1400, 1600, 0 };

	int n;
	while (scanf("%d", &n), n)
	{
		int ans = 0;
		while (n--)
		{
			int x, y, h, w;
			scanf("%d %d %d %d", &x, &y, &h, &w);
			int i;
			int s = x + y + h;
			for (i = 0; s > Size[i] || w > Weight[i]; ++i)
				;
			ans += Fee[i];
		}
		printf("%d\n", ans);
	}

	return 0;
}