// editor3
#include<stdio.h>
#include<stdlib.h>

typedef struct Product{
    char name[20];
    int id;
    float price;
}P;
int main(){
    int n,ind,j;
    scanf("%d",&n);
    if(n<0){
        printf("Invalid input");
        return 0;
    }
    P stud[n];
    float total=0;
    for(ind=0;ind<n;ind++){
        scanf("%s",stud[0].name);
        scanf("%d",&stud[0].id);
        scanf("%f",&stud[0].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);
    
    
}