// editor3
#include<stdio.h>
typedef struct Product{
    char name[];
    int id;
    float price;
}P;
int main(){
    int n,ind;
    scanf("%d",&n);
    if(n<0){
        printf("Invalid input");
        return 0;
    }
    S stud[n];
    float total=0;
    for(ind=0;ind<n;ind++){
        scanf("%s",stud[ind].name);
        scanf("%d",&stud[ind].id);
        scanf("%f",&stud[ind].price);
        for(j=0;stud[ind].name!='\0';j++){
            if(!isalnum(stud[ind].name[j])){
                printf("Invalid input");
                return 0;
            }
        }
        total+=stud[ind].price;
    }
    printf("%.2f",total);
    
    
}