
#include<stdio.h>
#include<stdlib.h>

#define N 10

typedef long long ll;

ll getI () {
    ll x;
    scanf("%lld", &x);
    return x;
}

double getD () {
    double x;
    scanf("%lf", &x);
    return x;
}

char *getS (int size) {
    char *s = (char*)malloc(sizeof(char)*(size+1));
    scanf("%s", s);
    return s;
}

int main () {

    ll n = getI();
    double sum = 0;
    for (int i=0; i<n; i++) {
        double x = getD();
        char *u = getS(3);

        if (*u=='B') {
            sum += x * 380000.0;
        }else{
            sum += x;
        }

        free(u);
    }

    printf("%lf\n", sum);
}
