// editor3
#include <stdio.h>
#include <ctype.h>

typedef struct order{
    char item;
    int id;
    float price;
} od; 

int main(){
     int n;
    scanf("%d", &n);
    if(n<0){
        printf("Invalifd input");
        return 0;
    }
    od arr[n];
    for(int i=0; i<n; i++){
        scanf("%s %d %f", &arr[i].item, &arr[i].id, &arr[i].price);
        for(int j=0;arr[i].item[j]!='\0'; j++){
            if(!isalnum(arr[i].item[j])){
                printf("Invalid input");
                return 0;
            }
        }
    }
    
    
    float sum =0.0;
    for(int i=0;i<n; i++){
        sum+=arr[i].price;
    }
    printf("%.2f",sum);
}