#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <algorithm>
#include <numeric>
#include <functional>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
using namespace std;

typedef istringstream ISS;
typedef ostringstream OSS;
typedef vector<string> VS;
typedef int INT;
typedef vector<INT> VI;
typedef vector<VI> VVI;
typedef pair <INT, INT> II;
typedef vector <II> VII;

template<class T> ostream& operator << ( ostream& os, vector<T> v ) {
    for ( typename vector<T>::iterator it_i = v.begin(); it_i != v.end(); ++it_i ) {
        os << *it_i << ", ";
    }
    return os;
}


const int SIZE = 1000000;
int X[SIZE], Y[SIZE], H[SIZE], W[SIZE];
int n;

long long solve() {
    long long res = 0;
    for ( int i = 0; i < n; ++ i ) {
        int s = X[i] + Y[i] + H[i];
        if ( s <= 60 && W[i] <= 2 ) {
            res += 600;
        } else if ( s <= 80 && W[i] <= 5 ) {
            res += 800;
        } else if ( s <= 100 && W[i] <= 10 ) {
            res += 1000;
        } else if ( s <= 120 && W[i] <= 15 ) {
            res += 1200;
        } else if ( s <= 140 && W[i] <= 20 ) {
            res += 1400;
        } else if ( s <= 160 && W[i] <= 25 ) {
            res += 1600;
        }
    }
    return res;
}

int main() {
    while ( cin >> n && n ) {
        for ( int i = 0; i < n; ++ i ) {
            cin >> X[i] >> Y[i] >> H[i] >> W[i];
        }
        cout << solve() << endl;
    }
    return 0;
}