#include <iostream>
#include <memory>
#include <memory.h>
#include <cmath>
#include <fstream>
#include <cmath>
#include <numeric>
#include <vector>
#include <stack>
#include <string>
#include <queue>
#include <sstream>
#include <cstdlib>
#include <cassert>
#include <cstdio>
#include <map>
#include <iomanip>
#include <list>
#include <cctype>
#include <algorithm>
#include <complex>
#define USE_MATH_DEFINES
#define rep(i, n) for(int i = 0; i < n; i++)
#define rep2(i, m, n) for(int i = m; i < n; i++)
using namespace std;

typedef complex<double> xy_t;
typedef pair<xy_t, xy_t> line;
typedef long long ll;
typedef pair<int, int> P;
typedef pair<int, P> PP;
typedef pair<int, PP> PPP;
const int INF = 1 << 29;
const double EPS = 1E-10;

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