#include<stdio.h>
#include<ctyoe.h>
#include<string.h>
 string product {
     char name[50];
     int id;
     float price;
 };
 
 int main() {
     int n;
     fload 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, &p.id, &p.price);
         
         for (int j =0; p.name[j] != '\0'; j++) {
             if (!isalpha(p.name[j])) {
                 printf("Invalid input");
                 return 0;
             }
         }
         
         total += p.price;
         
     }
     printF("%.2f",total);
     return 0;
     
 }