#include <bits/stdc++.h>
#define rep(i,a,n) for(int i=a;i<n;i++)
#define repb(i,a,b) for(int i=a;i>=b;i--)
#define all(a) a.begin(),a.end()
#define o(a) cout<<a<<endl
#define pb(a) push_back(a)
//#define int long long
#define fi first
#define se second
using namespace std;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> pii;

signed main() {
    int n;
    while(cin >> n, n){
        int x, y, h, w, ans = 0;
        rep(i, 0, n){
            cin >> x >> y >> h >> w;
            int size = -1, l = x + y + h;
            if(l <= 60 && w <= 2) size = 0;
            else if(l <= 80 && w <= 5) size = 1;
            else if(l <= 100 && w <= 10) size = 2;
            else if(l <= 120 && w <= 15) size = 3;
            else if(l <= 140 && w <= 20) size = 4;
            else if(l <= 160 && w <= 25) size = 5;
            //if(l > 160 || w > 25) size = -1;
            //o(size);
            if(size != -1) ans += (2*size + 6)*100;
        }
        cout << ans << endl;
    }
}