#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
typedef long long ll;
typedef pair<int, int> P;

int main() {
    while (true) {
        int n;
        cin >> n;
        if (n == 0) break;

        int ans = 0;
        rep(i, n) {
            int x, y, h, w;
            cin >> x >> y >> h >> w;
            int len = x+y+h;
            if (len <= 60 && w <= 2) ans += 600;
            else if (len <= 80 && w <= 5) ans += 800;
            else if (len <= 100 && w <= 10) ans += 1000;
            else if (len <= 120 && w <= 15) ans += 1200;
            else if (len <= 140 && w <= 20) ans += 1400;
            else if (len <= 160 && w <= 25) ans += 1600;
        }
        cout << ans << endl;
    }

    return 0;
}
