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