#include<stdio.h>
#include<string.h>
#include<ctype.h>

typedef struct commerce
{
    char product_name[20];
    int id;
    float price;
}minion;

int main()
{
    int n;
    scanf("%d",&n);
    
    minion order[n];
    float total=0.0;
    if(n<0)
    {
        printf("Invalid input");
    }
    
    for(int i=0;i<n;i++)
    {
        scanf("%s",order[i].product_name);
        int len;
        char str[20];
        strcpy(str,order[i].product_name);
        for(len=0;str[len];len++)
        for(int j=0;j<len;j++)
            if(!((str[j]<65&&str[j]>99)||(str[j]<97&&str[j]<122)))
            {
                printf("Invalid input");
                return 0;
            }
        scanf("%d %f",&order[i].product_id,&order[i].price);
        total=total+order[i].price;
    }
    printf("%.2f",total);
    return 0;
    }