#include <iostream>
#include <fstream>
#include <typeinfo>
#include <vector>
#include <cmath>
#include <set>
#include <map>
#include <string>
#include <algorithm>
#include <cstdio>
#include <queue>
#include <iomanip>
#include <cctype>
#define syosu(x) fixed<<setprecision(x)
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<double,double> pdd;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<char> vc;
typedef vector<vc> vvc;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef vector<P> vp;
typedef vector<vp> vvp;
typedef pair<int,P> pip;
typedef vector<pip> vip;
const int inf=1<<25;
const double pi=acos(-1);
const double eps=1e-8;
const vi emp;

int n;

int main(){
	while(1){
		cin>>n;
		if(!n) break;
		int ans=0,x,y,h,w,S;
		for(int i=0;i<n;i++){
			cin>>x>>y>>h>>w;
			S=x+y+h;
			if(S<=60&&w<=2) ans+=6;
			else if(S<=80&&w<=5) ans+=8;
			else if(S<=100&&w<=10) ans+=10;
			else if(S<=120&&w<=15) ans+=12;
			else if(S<=140&&w<=20) ans+=14;
			else if(S<=160&&w<=25) ans+=16;
		}
		cout<<ans*100<<endl;
	}
}