#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <utility>
#include <cstring>
#include <iomanip>
#include <numeric>
#include <limits>
#include <cmath>
#include <cassert>

using namespace std;
using ll = long long;

const int INF = 1<<30;
const int MOD = (int)1e9 + 7;
const int MAX_N = (int)1e5 + 5;
#define debug(x) cout << #x << ": " << x << endl

signed main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n;
    while(cin >> n, n)
    {
        int sum = 0;
        for(int i = 0; i < n; i++)
        {
            int x, y, h, w; cin >> x >> y >> h >> w;
            int large = x + y + h;
            if(large <= 60 and w <= 2) sum += 600;
            else if(large <= 80 and w <= 5) sum += 800;
            else if(large <= 100 and w <= 10) sum += 1000;
            else if(large <= 120 and w <= 15) sum += 1200;
            else if(large <= 140 and w <= 20) sum += 1400;
            else if(large <= 160 and w <= 25) sum += 1600;
        }
        cout << sum << endl;
    }
    return 0;
}


