#include<iostream>
#include<vector>
#include<string>
using namespace std;

int main() {
	while (1) {
		int a;
		cin >> a;
		if (a == 0)break;
		int s = 0;
		for (int b = 0; b < a; b++) {
			int c, d, e, f, g;
			cin >> c >> d >> e >> f;
			g = c + d + e;
			if (g > 160 || f > 25)s += 0;
			else 	if (g > 140 || f > 20)s += 1600;
			else if(g > 120 || f > 15)s += 1400;
			else if (g > 100 || f > 10)s += 1200;
			else if (g > 80 || f > 5)s += 1000;
			else if (g > 60 || f > 2)s += 800;
			else s += 600;
		}
		cout << s << endl;
	}
}