#include<iostream>
using namespace std;

int main(){
  int n;
  int x,y,z,w,l;
  int total;
  int s1,s2;

  while(1){
    cin >> n;
    if(!n)break;

    total = 0;

    for(int i=0;i<n;i++){
      cin >> x >> y >> z >> w;
      l = x + y + z;
      if(l>160)s1 = 6;
      else if(l>140)s1 = 5;
      else if(l>120)s1 = 4;
      else if(l>100)s1 = 3;
      else if(l>80)s1 = 2;
      else if(l>60)s1 = 1;
      else s1 = 0;
      if(w>25)s2 = 6;
      else if(w>20)s2 = 5;
      else if(w>15)s2 = 4;
      else if(w>10)s2 = 3;
      else if(w>5)s2 = 2;
      else if(w>2)s2 = 1;
      else s2 = 0;

      if(s1<s2)s1 = s2;

      if(s1==0)total += 600;
      else if(s1==1)total += 800;
      else if(s1==2)total += 1000;
      else if(s1==3)total += 1200;
      else if(s1==4)total += 1400;
      else if(s1==5)total += 1600;
    }
    cout << total << endl;
  }
}