#include<iostream>
#include<cstdio>
#include<algorithm>
#include<climits>
#include<string>
#include<vector>
#include<list>
#include<map>
#include<set>
#include<cmath>
#include<queue>
#include<cstring>
#include<stack>
#include<functional>
using namespace std;

int main(){
	int N;
	while(cin>>N,N){
		int ans = 0;
		for(int i=0;i<N;i++){
			int X,Y,H,W; cin>>X>>Y>>H>>W;
			int b = X+Y+H;
			if(b<=60 && W<=2) ans += 600;
			else if(b<=80 && W<=5) ans += 800;
			else if(b<=100 && W<=10) ans += 1000;
			else if(b<=120 && W<=15) ans += 1200;
			else if(b<=140 && W<=20) ans += 1400;
			else if(b<=160 && W<=25) ans += 1600;
		}
		printf("%d\n",ans);
	}
	return 0;
}