#include <vector>
#include <iostream>
#include <utility>
#include <algorithm>
#include <string>
#include <deque>
#include <queue>
#include <tuple>
#include <queue>
#include <functional>
#include <cmath>
#include <iomanip>
#include <map>
#include <set>
#include <numeric>
#include <unordered_map>
#include <unordered_set>
#include <complex>
#include <iterator>
#include <array>
#include <memory>
#include <stack>
#define vi vector<int>
#define vvi vector<vector<int> >
#define ll long long int
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vb vector<bool>
#define vc vector<char>
#define vs vector<string>
#define ld long double
#define INF 1e9
#define EPS 0.0000000001
#define rep(i,n) for(int i=0;i<n;i++)
#define loop(i,s,n) for(int i=s;i<n;i++)
#define all(in) in.begin(), in.end()
template<class T, class S> void cmin(T &a, const S &b) { if (a > b)a = b; }
template<class T, class S> void cmax(T &a, const S &b) { if (a < b)a = b; }
#define MAX 9999999
using namespace std;
typedef pair<int, int> pii;
typedef pair<double,double>pdd;
typedef pair<ll,ll>pll;
int main(){
    int n;
    while(cin>>n,n){
        int ans=0;
        rep(i,n){
            int rize,syaro,tiya,tino;
            cin>>rize>>syaro>>tiya>>tino;
            tiya+=rize+syaro;
            if(tiya<=60&&tino<=2)
                ans+=600;
            else if(tiya<=80&&tino<=5)
                ans+=800;
            else if(tiya<=100&&tino<=10)
                ans+=1000;
            else if(tiya<=120&&tino<=15)
                ans+=1200;
            else if(tiya<=140&&tino<=20)
                ans+=1400;
            else if(tiya<=160&&tino<=25)
                ans+=1600;
        }
        cout<<ans<<endl;
    }
}