#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<map>
#include<cstring>
using namespace std;

#define rep(i,n) for(int i=0;i<n;i++)
#define REP(n) rep(i,n)
#define all(n) n.begin(),n.end()

const int C = 6;

int sl[] = {60, 80, 100, 120, 140, 160};
int wl[] = {2, 5, 10, 15, 20, 25};
int cost[] = {600, 800, 1000, 1200, 1400, 1600};

int main()
{
    int n;
    int x, y, h , w, c;
    while(cin >> n && n)
    {
        long long ans = 0;
        REP(n)
        {
            cin >> x >> y >> h >> w;
            c = 0;
            h = h + x + y;
            rep(j,C)if( h <= sl[j] && w <= wl[j]){ c = cost[j]; break;}

            ans += c;
        }
        cout << ans << endl;
    }

    return 0;
}