#define _USE_MATH_DEFINES
#include<iostream>
#include<cstdio>
#include<vector>
#include<algorithm>
#include<string>
#include<cmath>
#include<list>
#include<stack>
#include<queue>
#include<cctype>
#include<iomanip>
#include<functional>
#include<numeric>
#include<map>
#include<set>
#include<complex>
#define EPS 1e-10
using namespace std;
typedef long long llong;
int x, y, h, w;
int judge_weight(int x, int y, int h, int w) {
	if (x + y + h <= 60 && w <= 2) return 600;
	else if (x + y + h <= 80 && w <= 5) return 800;
	else if (x + y + h <= 100 && w <= 10) return 1000;
	else if (x + y + h <= 120 && w <= 15) return 1200;
	else if (x + y + h <= 140 && w <= 20) return 1400;
	else if (x + y + h <= 160 && w <= 25) return 1600;
	else return 0;
}
int main() {
	int n;
	while (cin >> n&&n) {
		int sum = 0;
		for (int i = 0; i < n; i++) {
			cin >> x >> y >> h >> w;
			sum += judge_weight(x, y, h, w);
		}
		cout << sum << endl;
	}

	return 0;
}