#include<stdio.h>
#include string.h
typedef struct cart{
    char name[20];
    int ID;
    float price;
}dhee;
int main(){
    int n,ind;
    float total;
    scanf("%d",&n);
    if(n<0){
        printf("Invalid input");
        return 0;
    }
    dhee stud[n];
    for(ind=0;ind<n;ind++){
        scanf("%s",stud[ind].name);
        char str[20];
        int len;
        strcpy(str,stud[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",&stud[ind].ID);
        scanf("%f",&stud[ind].price);
    }
    total=stud[0].price+stud[1].price+stud[2].price;
    printf("%.2f",total);
    return 0;
}