#include <iostream>
using namespace std;

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