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