#include <iostream>
#include <algorithm>

using namespace std;

enum size{
    A,B,C,D,E,F,X
};
typedef long long ll;
ll solve(int n){
    ll some = 0;
    for(int i=0;i<n;i++){
        int x,y,h,w;
        size sis = X;
        size siw = X;
        cin >> x >> y >> h >> w;
        int s = x+y+h;
        if(s <= 160) sis = F;
        if(s <= 140) sis = E;
        if(s <= 120) sis = D;
        if(s <= 100) sis = C;
        if(s <= 80) sis = B;
        if(s <= 60) sis = A;

        if(w <= 25) siw = F;
        if(w <= 20) siw = E;
        if(w <= 15) siw = D;
        if(w <= 10) siw = C;
        if(w <= 5) siw = B;
        if(w <= 2) siw = A;

        size sss = max(siw,sis);
        switch(sss){
        case X:
            break;
        case F:
            some += 1600;
            break;
        case E:
            some += 1400;
            break;
        case D:
            some += 1200;
            break;
        case C:
            some += 1000;
            break;
        case B:
            some += 800;
            break;
        case A:
            some += 600;
            break;
        }
    }
    return some;
}

int main(){
    int n;
    while(cin >> n && n != 0) cout << solve(n) << endl;
}