#include <stdio.h>
int n, x, y, z, t, w;
int main() {
	while(~scanf("%d", &n), n) {
		int ret = 0;
		for(int i = 0; i < n; i++) {
			scanf("%d%d%d%d", &x, &y, &z, &w); t = x + y + z;
			if(t <= 60 && w <= 2) ret += 600;
			else if(t <= 80 && w <= 5) ret += 800;
			else if(t <= 100 && w <= 10) ret += 1000;
			else if(t <= 120 && w <= 15) ret += 1200;
			else if(t <= 140 && w <= 20) ret += 1400;
			else if(t <= 160 && w <= 25) ret += 1600;
		}
		printf("%d\n", ret);
	}
	return 0;
}