#include <iostream>
using namespace std;

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