#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <complex>
#include <cstring>
#include <cstdlib>
#include <string>
#include <cmath>
#include <queue>
using namespace std;

#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 INF 1<<30

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