#include<bits/stdc++.h>
using namespace std;

string s;
double ans,x;

int main()
{
	int n;
	cin>>n;
	for (int i=1; i<=n; ++i)
	{
		cin>>x>>s;
		if (s=="JPY") ans+=x;
		else ans+=x*380000;
	}
	printf("%.5lf",ans);
}