#include <iostream>
#include <string>
using namespace std;

int n;
float x, ans=0;
string s;

int main(void){
	cin >> n;
	for(int i=0; i<n; i++){
		cin >> x >> s;
		if(s=="JPY") ans += x;
		if(s=="BTC") ans += x*380000;
	}
	cout << ans << endl;
}