#include <stdio.h>
#include <iostream>

using namespace std;

int main() {
	int n;
	int x,y,h,w;
	int ryoukin;
	int sum;
	while (cin >> n) {
		if (n== 0) {
			break;
		}
		ryoukin = 0;
		for (int i = 0; i < n; i++) {
			cin >> x >> y >> h >> w;
			sum = x + y + h;
			if (sum <= 60 && w <= 2) {
				ryoukin += 600;
			} else if (sum <= 80 && w <= 5) {
				ryoukin+= 800;
			} else if (sum <= 100 && w <= 10) {
				ryoukin += 1000;
			} else if (sum <= 120 && w <= 15) {
				ryoukin += 1200;
			} else if (sum <= 140 && w <= 20) {
				ryoukin += 1400;
			} else if (sum <= 160 && w <= 25) {
				ryoukin += 1600;
			}
		}
		cout << ryoukin << endl;
	}
	return 0;
}