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