#include<stdio.h>
#include<string.h>
#include<ctype.h>

struct ord
{
 char name[50];
 int id;
 float price;
};
int isvalidname(char str[])
{
    for(int i=0;str[i] != '\0'; i++)
    {
        if(!isalnum(str[i]))
        {
            return 0;
        }
    }
    return 1;
}
int main()
{
    int n;
    scanf("%d",&n);
    if(n <= 0)
    {
        printf("Invalid input");
        return 0;
    }
    struct ord s[n];
    float tot = 0.0;
    for(int i = 0; i < n; i++)
    {
        scanf("%s",s[i].name);
        scanf("%d",&s[i].id);
        scanf("%f",&s[i].price);
        if(!isvalidname(s[i].name)
        {
            printf("Invalid input");
        }
        tot += s[i].price;
    }
    printf("%.2f",tot);
    
     return 0;
}