#include<stdio.h>

union Salary {
    int full_time;
    float hourly;
};

struct Employee {
    char name[100];
    int id;
    int type;
    union Salary sal;
};

int main() {
    int n;
    scanf("%d", &n);
    
    struct Employee emp;
    double 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.sal.full_time_salary);
            total += emp.sal.full_time_salary;
        }else if (emp.type == 2) {
            scanf("%f", &emp.sal.hourly_rate);
            total += emp.sal.hourly_rate;
        }
    }
    printf("%.2lf\n",total);
    return 0;
}