from decimal import Decimal
def currency_exchange():
currency = input()
exchange_rate = float(input())
if exchange_rate <= 0:
return 'Data error!'
if currency[-1] == '$':
currency_convert = Decimal(float(currency[-len(currency):-1:1]) * exchange_rate).quantize(Decimal('0.01'),
rounding='ROUND_HALF_UP')
return f'{currency_convert}¥'
elif currency[-1] == '¥':
currency_convert = Decimal(float(currency[-len(currency):-1:1]) / exchange_rate).quantize(Decimal('0.01'),
rounding='ROUND_HALF_UP')
return f'{currency_convert}$'
else:
return 'Data error!'
print(currency_exchange())