#include<iostream>
#include<algorithm>
using namespace std;


int sb[6]={60,80,100,120,140,160};
int wb[6]={2,5,10,15,20,25};

int main(){
	int n;
	while(cin>>n&&n){
		int s=0;
		for(int i=0;i<n;i++){
			int x,y,h,w;
			cin>>x>>y>>h>>w;
			int a,b;
			a=lower_bound(sb,sb+6,x+y+h)-sb;
			b=lower_bound(wb,wb+6,w)-wb;
			if(a==6||b==6)continue;
			s+=600+200*max(a,b);
		}
		cout<<s<<endl;
	}
	return 0;
}