#include<iostream>
using namespace std;
int main(){
  int x,y,h,w;
  int n;
  int ans;
  int s[6] = {60,80,100,120,140,160};
  int wh[6] = {2,5,10,15,20,25};
  while(cin >> n){
    if(n==0) break;
    ans = 0;
    for(int i=0;i<n;i++){
      cin >> x >> y >> h >> w;
      h = x + y + h;
      //cout << h << endl;
	for(int i=5;i>=0;i--){
	  if(i==0) h = 0;
	  else if(i==5&&s[i]<h){
	    h = 7;
	    break;
	  }
	  else if(s[i-1]<h&&h<=s[i]){
	    h = i;
	    break;
	  }
	}
	for(int i=5;i>=0;i--){
	  if(i==0) w = 0;
	  else if(i==5&&wh[i]<w){
	    w = 7;
	    break;
	  }
	  else if(wh[i-1]<w&&w<=wh[i]){
	    w = i;
	    break;
	  }
	}
	if(h<w) h = w;
	//cout << h << endl;
	switch(h){
	case 0:
	  ans += 600;
	  break;
	case 1:
	  ans += 800;
	  break;
	case 2:
	  ans+= 1000;
	  break;
	case 3:
	  ans += 1200;
	  break;
	case 4:
	  ans += 1400;
	  break;
	case 5:
	  ans += 1600;
	  break;
	}
    }
    cout << ans << endl;
  }
  return 0;
}