#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <cstring>
#include <sstream>
#include <cassert>
using namespace std;
static const double EPS = 1e-5;
typedef long long ll;
typedef pair<int,int> PI;
typedef vector<int> vi;
#define rep(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define ALL(c) (c).begin(), (c).end()
#define mp make_pair
#define pb push_back
#define f first
#define s second

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