#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("%5 %d %f",p.name, &p.id, &p.price);
        for (int j = 0; p.name[j] !='\0'; j++) {
            if (!isalpha(p.name[j])) {
                printf("Inavalid input");
                return 0;
            }
        }
        total += p.price;
    }
    printf("%.2f,total);
    return 0;
}