#include<stdio.h>

struct Employee {
    char name[100];
    int id;
    int type;
    
    union {
        int fullSalary;
        float hourlyRate;
    } pay;
};
int main() {
    int n;
    scanf("%d",&n);
    return 0;
   }
   struct Employee e;
   float total =0.0;

    for(int i=0;i<n;i++) {
    scanf("%s %d %d",e.name,&e.id,&e.type);
    if(e.type ==1)
    {
    scanf("%d",&e.pay.fullSalary);
    total+=e.pay.fullSalary;
    }
    else if(e.typr ==2)
    {
        scanf("%f",&e.pay.hourlyRate);
        total += e.pay.hourlyRate;
    }

}
printf("%.2f", total);
return 0;
}