#include<bits/stdc++.h>
using namespace std;

int main()
{
  int n;
  while( cin >> n, n ) {
    int a, b, c, d;
    int sum = 0;

    while( n-- ) {
      int size = 0;
      cin >> a >> b >> c >> d;
      size += a + b + c;
      
      if( size <= 60 && d <= 2 ) {
	sum += 600;
      } 
      else if( size <= 80 && d <= 5 ) {
	sum += 800;
      }
      else if( size <= 100 && d <= 10 ) {
	sum += 1000;
      }
      else if( size <= 120 && d <= 15 ) {
	sum += 1200;
      }
      else if( size <= 140 && d <= 20 ) {
	sum += 1400;
      }
      else if( size <= 160 && d <= 25 ) {
	sum += 1600;
      }
    }

    cout << sum << endl;
  }

}