#include<stdio.h> 
union salary {
    int full;
    float part;
};
int main()
{
    int n, id, type;
    char name[50];
    union salary s;
    float total = 0;
    scanf("%d", &n);
    if (n < 0) {
        printf("-1");
        return 0;
    }
    for (int i = 0; i < n; i++) {
        scanf("%s %d %d", name, &id, &type);
        if(type == 1) {
            scanf("%d",&s.full);
            total += s.full;
        } else {
            scanf("%f", &s.part);
            total += s.part;
        }
    }
    printf("%.2f", totalsalary);
    return 0;
}