unittest
{
	assert( [ "2", "10000 JPY", "0.10000000 BTC" ].parse.expand.solve == 48000.0 );
	assert( [ "3", "100000000 JPY", "100.00000000 BTC", "0.00000001 BTC" ].parse.expand.solve == 138000000.0038 );
}



import std.conv;
import std.range;
import std.stdio;
import std.typecons;

void main()
{
	stdin.byLineCopy.parse.expand.solve.writeln;
}
auto parse( Range )( Range input )
if( isInputRange!Range && is( ElementType!Range == string ) )
{
	auto n = input.front.to!( long );
	auto xs = new real[ n ];
	auto us = new string[ n ];
	foreach( ref x, ref u; lockstep( xs, us ) )
	{
		input.popFront;
		auto t = input.front.split;
		x = t[ 0 ].to!( real );
		u = t[ 1 ];
	}
	return tuple( xs, us );
}

auto solve( real[] xs, string[] us )
{
	const BTC_RATE = 380000.0f;
	
	real ans = 0f;
	
	foreach( x, u; lockstep( xs, us ) )
	{
		switch( u )
		{
			case "JPY": ans += x;            break;
			case "BTC": ans += x * BTC_RATE; break;
			default   : assert( false );
		}
	}
	
	return ans;
}
