#include<stdio.h>
struct platform{
    char name[20];
    int id;
    float price;
    int total;
};
int main()
{
    int size,ind;
    scanf("%d",&size);
    if(size<0){
        printf("Invalid input");
        return 0;
    }
    struct platform plt[size];
    for(ind=0;ind<size;ind++){
        scanf("%s",plt[ind].name);
        char str[20];
        int len;
        strcpy(str,plt[ind].name);
        for(len=0;str[len];len++);
        for(int i=0;i<len;i++) {
            if(!((str[i]>=65&&str[i]<=90) || (str[i]>=97&&str[i]<=122))){
                printf("Invalid input");
                return 0;
                
            }
        }
        scanf("%d",&plt[ind].id);
        scanf("%s",plt[ind].name);
        scanf("%2f",plt[ind].price);
        
    } 
     for(ind=0;ind<size;ind++){
         total+=plt[ind].price;
     }
    printf("%2f",total);
}