#include <iostream>
using namespace std;

int fee_list[6] = {600, 800, 1000, 1200, 1400, 1600};

int checkSize(int x, int y, int h);
int checkWeight(int w);

int main()
{
    int n;
    while(1)
    {
        int ans = 0;
        cin >> n;
        if(n == 0)
        {
            break;
        }
        for(int i=0; i<n; i++)
        {
            int x;
            int y;
            int h;
            int w;
            int rank;
            cin >> x >> y >> h >> w;
            rank = std::max(checkSize(x, y, h),checkWeight(w));
            if(rank < 6)
            {
                ans += fee_list[rank];
            }
        }
        cout << ans << endl;
    }
    return 0;
}

int checkSize(int x, int y, int h)
{
    int total = x + y + h;
    int ret_value;

    if(total <= 60)
    {
        ret_value = 0;
    }
    else if(total <= 80)
    {
        ret_value = 1;
    }
    else if(total <= 100)
    {
        ret_value = 2;
    }
    else if(total <= 120)
    {
        ret_value = 3;
    }
    else if(total <= 140)
    {
        ret_value = 4;
    }
    else if(total <= 160)
    {
        ret_value = 5;
    }
    else
    {
        ret_value = 6;
    }
    return ret_value;
}

int checkWeight(int w)
{
    int ret_value;

    if(w <= 2)
    {
        ret_value = 0;
    }
    else if(w <= 5)
    {
        ret_value = 1;
    }
    else if(w <= 10)
    {
        ret_value = 2;
    }
    else if(w <= 15)
    {
        ret_value = 3;
    }
    else if(w <= 20)
    {
        ret_value = 4;
    }
    else if(w <= 25)
    {
        ret_value = 5;
    }
    else
    {
        ret_value = 6;
    }
    return ret_value;
}