#include<stdio.h>
union payinfo
{
    int fulltimeSalary;
    float partTimeRate;
};
struct employee
{
    char name[50];
    int id;
    int type;
    union payinfo pay;
};
int main()
{
    int n;
    scanf("%d", &n);
    struct employee emp;
    float total=0.0;
    for(int i=0;i<n;i++)
    {
        scanf("%s", emp.name);
        scanf("%d %d",&emp.id,&emp.type);
        if(emp.type==1)
        {
            scanf("%d",&emp.pay.fullTimeSalary);
            total+=emp.pay.fullTimeSalary;
        }
        else if(emp.type==2)
        {
            int hours;
            scanf("%f %d",&emp.pay.partTimeRate,&hours);
            total+=emp.pay.partTimeRate*hours;
        }
    }
    printf("%.2f",);
    return 0
}