Takahashi received otoshidama (New Year's money gifts) from N of his relatives.
You are given N values x_1, x_2, ..., x_N and N strings u_1, u_2, ..., u_N as input. Each string u_i is either JPY or BTC, and x_i and u_i represent the content of the otoshidama from the i-th relative.
For example, if x_1 = 10000 and u_1 = JPY, the otoshidama from the first relative is 10000 Japanese yen; if x_2 = 0.10000000 and u_2 = BTC, the otoshidama from the second relative is 0.1 bitcoins.
If we convert the bitcoins into yen at the rate of 380000.0 JPY per 1.0 BTC, how much are the gifts worth in total?

-----Constraints-----
 - 2 \leq N \leq 10
 - u_i = JPY or BTC.
 - If u_i = JPY, x_i is an integer such that 1 \leq x_i \leq 10^8.
 - If u_i = BTC, x_i is a decimal with 8 decimal digits, such that 0.00000001 \leq x_i \leq 100.00000000.

-----Input-----
Input is given from Standard Input in the following format:
N
x_1 u_1
x_2 u_2
:
x_N u_N

-----Output-----
If the gifts are worth Y yen in total, print the value Y (not necessarily an integer).
Output will be judged correct when the absolute or relative error from the judge's output is at most 10^{-5}.

-----Sample Input-----
2
10000 JPY
0.10000000 BTC

-----Sample Output-----
48000.0

The otoshidama from the first relative is 10000 yen. The otoshidama from the second relative is 0.1 bitcoins, which is worth 38000.0 yen if converted at the rate of 380000.0 JPY per 1.0 BTC. The sum of these is 48000.0 yen.
Outputs such as 48000 and 48000.1 will also be judged correct.
[{"code": "N = int(input())\nx = [0] * N\nu = [0] * N\nfor i in range(N):\n    x[i], u[i] = list(map(str, input().split()))\n\nans = 0\nfor i in range(N):\n    if u[i] == 'JPY':\n        ans += float(x[i])\n    else:\n        ans += float(x[i]) * 380000\n\nprint(ans)\n", "passed": true, "time": 0.16, "memory": 14176.0, "status": "done"}, {"code": "btc=380000\nN=int(input())\nans=0\nfor i in range(N):\n  x,u=input().split()\n  if u=='JPY':\n    ans+=float(x)\n  else:\n    ans+=float(x)*btc\nprint(ans)\n", "passed": true, "time": 0.16, "memory": 14256.0, "status": "done"}, {"code": "n=int(input())\nx_list=[]\nu_list=[]\nfor i in range(n):\n  x,u=input().split()\n  x_list.append(float(x))\n  u_list.append(u)\nsum=0\nfor i in range(n):\n  if u_list[i]==\"JPY\":\n    sum+=x_list[i]\n  else:\n    sum+=x_list[i]*380000.0\nprint(sum)", "passed": true, "time": 0.15, "memory": 14328.0, "status": "done"}, {"code": "N = int(input())\nbtc_a = 380000.0\nbtc_b = btc_a / (10 ** 8)\nans = 0.0\nfor i in range(N):\n  x, n = input().split()\n  if n == \"JPY\":\n    ans += int(x)\n  else:\n    a, b = map(int, x.split(\".\"))\n    ans += a * btc_a\n    ans += b * btc_b\nprint(ans)", "passed": true, "time": 1.65, "memory": 14272.0, "status": "done"}, {"code": "n = int(input())\n\nans = 0\n\nfor i in range(n):\n\n    x,u = input().split()\n    x = float(x)\n\n    if(u=='BTC'):\n        x *= 380000\n    \n    ans += x\n\nprint(ans)\n\n", "passed": true, "time": 0.16, "memory": 14188.0, "status": "done"}, {"code": "n=int(input())\nsum=0\nfor i in range(n):\n    x,u=input().split()\n    x=float(x)\n    if u=='JPY':\n        sum+=x\n    else:\n        sum+=x*380000\nprint(sum)", "passed": true, "time": 0.14, "memory": 14136.0, "status": "done"}, {"code": "n=int(input())\nkei = 0.0\nfor i in range(n):\n    x,u=map(str,input().split())\n    if u==\"JPY\":\n        kei += float(x)\n    else:\n        kei += float(x)*380000.0\nprint(kei)", "passed": true, "time": 0.15, "memory": 14132.0, "status": "done"}, {"code": "N=int(input())\nlist=[]\nfor i in range(N):\n  a,b=input().split()\n  list.append((float(a), b))\nsum=0\nfor i in range(N):\n  if list[i][1]==\"JPY\" :\n    sum+=list[i][0]\n  else :\n    sum+=list[i][0]*380000\nprint(sum)", "passed": true, "time": 0.14, "memory": 14348.0, "status": "done"}, {"code": "N = int(input())\nX = []\nU = []\nfor _ in range(N):\n    x, u = input().split()\n    X.append(float(x))\n    U.append(u)\n\nans = 0\nfor x, u in zip(X, U):\n    if u == 'JPY':\n        ans += x\n    else:\n        ans += x*380000.\nprint(ans)\n", "passed": true, "time": 0.14, "memory": 14344.0, "status": "done"}, {"code": "n = int(input())\nlist = []\nfor i in range(n):\n    a,b=input().split()\n    list.append([float(a), b])\nans=0\nfor i in range(n):\n    if(list[i][1]=='JPY'):\n        ans+=list[i][0]\n    else:\n        ans+= 380000*list[i][0];\n    \nprint(ans)\n", "passed": true, "time": 0.14, "memory": 14296.0, "status": "done"}, {"code": "N=int(input())\nans=0\nfor _ in range(N):\n    x,u=input().split()\n    x=float(x)\n    if u==\"JPY\":\n        ans+=x\n    else:\n        ans+=380000*x\nprint(ans)\n", "passed": true, "time": 0.17, "memory": 14284.0, "status": "done"}, {"code": "n = int(input())\nans = 0\nfor _ in range(n):\n    x, u = input().split()\n    x = float(x)\n    if u == 'BTC':\n        x *= 380000\n    ans += x\nprint(ans)", "passed": true, "time": 0.14, "memory": 14172.0, "status": "done"}, {"code": "n = int(input())\ncnt = 0\nfor _ in range(n):\n    x,u = map(str, input().split())\n    if u == \"JPY\":\n        cnt += float(x)\n    else:\n        cnt += float(x) * 380000.0\nprint(cnt)", "passed": true, "time": 0.14, "memory": 14136.0, "status": "done"}, {"code": "n=int(input())\nsm=0\nfor i in range(n):\n    x,u=input().split()\n    x=float(x)\n    if u==\"BTC\":\n        x*=380000.0\n    sm+=x\nprint(sm)", "passed": true, "time": 0.14, "memory": 14272.0, "status": "done"}, {"code": "N = int(input())\n\nans = 0\n\nfor _ in range(N):\n    x,u = input().split()\n    x = float(x)\n    if u == 'BTC':\n        ans += 380000*x\n    else:\n        ans += x\n\nprint(ans)", "passed": true, "time": 0.14, "memory": 14232.0, "status": "done"}, {"code": "n = int(input())\n\nans = 0\nfor i in range(n):\n    x, u = input().split()\n\n    if u == 'JPY':\n        ans += float(x)\n    else:\n        ans += float(x) * 380000.0\n\nprint(ans)\n", "passed": true, "time": 0.14, "memory": 14300.0, "status": "done"}, {"code": "def readinput():\n    n=int(input())\n    dama=[]\n    for _ in range(n):\n        a,b=input().split()\n        dama.append((a,b))\n    return n,dama\n\ndef main(n,dama):\n    sum=0.0\n    for x,u in dama:\n        if u=='JPY':\n            sum+=int(x)\n        else:\n            sum+=float(x)*380000.0\n    return sum\n\ndef __starting_point():\n    n,dama=readinput()\n    ans=main(n,dama)\n    print(ans)\n\n__starting_point()", "passed": true, "time": 0.17, "memory": 14056.0, "status": "done"}, {"code": "n = int(input())\n\nab = [list(input().split()) for _ in range(n)]\njpy =0\nbtc =0\n\nfor i in range(n):\n    if ab[i][1] ==\"JPY\":\n        jpy += float(ab[i][0])\n    \n    elif ab[i][1] ==\"BTC\":\n        btc += float(ab[i][0])\n\nprint (jpy + btc *380000.0)", "passed": true, "time": 0.25, "memory": 14216.0, "status": "done"}, {"code": "n=int(input())\n\nans=0\n\nfor i in range(n):\n    x,u=input().split()\n\n    if(u==\"JPY\"):\n        ans+=float(x)\n    else:\n        ans+=float(x)*380000\n\nprint(ans)\n", "passed": true, "time": 0.24, "memory": 14124.0, "status": "done"}, {"code": "n = int(input())\nxu = [list(input().split()) for _ in range(n)]\n\nmoney = 0\n\nfor k in xu:\n    if k[1] == \"JPY\":\n        money += float(k[0])\n    else:\n        money += float(k[0])*380000\n\nprint(money)", "passed": true, "time": 0.24, "memory": 14080.0, "status": "done"}, {"code": "n=int(input())\nx=[]\nu=[]\nyen=0\nbit=0\nfor i in range(n):\n    a,b=input().split()\n    x.append(float(a))\n    u.append(b)\nfor i in range(n):\n    if u[i]==\"JPY\":\n        yen+=x[i]\n    else:\n        bit+=x[i]\nprint(yen+380000*bit)", "passed": true, "time": 0.14, "memory": 14132.0, "status": "done"}, {"code": "n = int(input())\na = 0\nfor i in range(n):\n  v, c = input().split()\n  v = float(v)\n  if c == \"JPY\":\n    a += v\n  else:\n    a += v * 380000.0\nprint(a)", "passed": true, "time": 0.15, "memory": 14132.0, "status": "done"}, {"code": "# import numpy as np\n# import math\n\n# from scipy.special import perm : perm(n, r, exact=True)\n# from scipy.special import comb : comb(n, r, exact=True)\n\n# import itertools\n# for v in itertools.combinations(L, n):M.append(list(v))\n\n# from numba import njit\n# @njit('f8(i8,i8,i8,i8,f8[:,:,:])', cache=True)\n\n\n\"\"\" Definitions  \"\"\"\n\ndef lcm(a, b):\n    return a*b//math.gcd(a, b)\n\nMOD = 10**9+7\n\n# ============================================================\n\nn = int(input())\nans = 0\nfor i in range(n):\n    x, u = input().split()\n    x = float(x)\n    if u == 'JPY':\n        ans += x\n    else:\n        ans += x * 380000\nprint(ans)\n", "passed": true, "time": 0.21, "memory": 14276.0, "status": "done"}, {"code": "N = int(input())\nx = [0 for i in range(N)]\nu = ['' for i in range(N)]\nfor i in range(N):\n  x[i], u[i] = map(str, input().split())\n  x[i] = float(x[i])\n\nmoney = 0\nfor i in range(N):\n  if u[i] == 'JPY':\n    money += x[i]\n  else:\n    money += x[i] * 380000.0\nprint(money)", "passed": true, "time": 0.15, "memory": 14364.0, "status": "done"}, {"code": "n = int(input())\nans = float(0)\nfor _ in range(n):\n  m, u = input().split()\n  m = float(m)\n  if u == 'JPY':\n    ans += m\n  else:\n    ans += m * float(380000)\nprint(ans)", "passed": true, "time": 0.15, "memory": 14280.0, "status": "done"}, {"code": "n=int(input())\nans=0\nfor i in range(n):\n  x,u=map(str,input().split())\n  x=float(x)\n  if u == \"JPY\":\n    ans += x\n  else:\n    ans += 380000*x\nprint(ans)", "passed": true, "time": 0.14, "memory": 14192.0, "status": "done"}, {"code": "N = int(input())\nj = 0\nfor i in range(N):\n    x,u = map(str,input().split())\n    x = float(x)\n    if u == 'BTC':\n        j += x*380000\n    if u == 'JPY':\n        j += x\nprint(j)", "passed": true, "time": 0.15, "memory": 14052.0, "status": "done"}, {"code": "n=int(input())\nans=0\nfor i in range(n):\n  a,b=map(str, input().split())\n  if b=='JPY':\n    ans+=float(a)\n  else:\n    ans+=float(a)*380000\nprint(ans)", "passed": true, "time": 0.14, "memory": 14236.0, "status": "done"}, {"code": "bit = 380000.0\n\nn = int(input())\nans = 0\nfor i in range(n):\n    x, u = input().split()\n    x = float(x)\n    if u == 'JPY':\n        ans += x\n    else:\n        ans += x * bit\nprint(ans)", "passed": true, "time": 0.14, "memory": 14360.0, "status": "done"}, {"code": "N = int(input())\n\nresult = 0\n\nfor _ in range(N):\n  x, u = input().split()\n  x = float(x)\n  \n  if u == \"JPY\":\n    result += x\n  else:\n    result += x * (3.8 * 10 ** 5)\n    \nprint(result)", "passed": true, "time": 0.14, "memory": 14296.0, "status": "done"}, {"code": "def mapt(fn, *args):\n    return tuple(map(fn, *args))\n  \n\ndef Vector(line):\n    return mapt(Atom, line.split(\" \"))\n\n\ndef Atom(segment):\n    try:\n        return float(segment)\n    except ValueError:\n        try:\n            int(segment)\n        except ValueError:\n            return segment\n\ndef main():\n    n = int(input())\n    data = [Vector(input()) for _ in range(n)]\n    total = 0\n    for amount, currency in data:\n        if currency == \"JPY\":\n            total += amount\n        else:\n            total += amount * 380000\n    print(total)\n\nmain()", "passed": true, "time": 0.14, "memory": 14296.0, "status": "done"}, {"code": "from typing import List, Tuple\n\n\ndef answer(n: int, xus: List[Tuple[float, str]]) -> float:\n    otoshidama = 0\n    for x, u in xus:\n        if u == 'BTC':\n            otoshidama += x * 380000.0\n        else:\n            otoshidama += x\n            \n    return otoshidama\n\n\ndef main():\n    n = int(input())\n    xus = []\n    for i in range(n):\n        x, u = input().split()\n        xus.append((float(x), u))\n\n    print(answer(n, xus))\n\n\ndef __starting_point():\n    main()\n__starting_point()", "passed": true, "time": 0.15, "memory": 15036.0, "status": "done"}, {"code": "N=int(input())\nans = 0\nfor _ in range(N):\n    x,u = input().split()\n    x = float(x)\n    if u == \"JPY\":\n        ans += x\n    else:\n        ans += x*380000\nprint(ans)", "passed": true, "time": 0.15, "memory": 14144.0, "status": "done"}, {"code": "N = int(input())\n\nans = 0\nfor i in range(N):\n    x, u = input().split()\n    x = float(x)\n    if u == 'BTC':\n        ans += 380000.0*x\n    elif u == 'JPY':\n        ans += x\n\nprint(ans)\n", "passed": true, "time": 0.15, "memory": 14128.0, "status": "done"}, {"code": "n = int(input())\nli = [list(input().split()) for i in range(n)]\ntotal = 0\n\nfor i in range(n):\n    if li[i][1] == 'JPY':\n        total += float(li[i][0])\n    else:\n        total += float(li[i][0])*380000.0\n\nprint(total)", "passed": true, "time": 0.15, "memory": 14184.0, "status": "done"}, {"code": "n=int(input())\njpy=btc=0\nfor i in range(n):\n    x,u = map(str,input().split())\n    if u==\"JPY\":\n        jpy+=int(x)\n    else:\n        btc+=float(x)\n\nans = jpy+380000.0*btc\nprint(ans)", "passed": true, "time": 0.24, "memory": 14104.0, "status": "done"}, {"code": "n=int(input())\nans=0\nfor i in range(n):\n    x,u=input().split()\n    x=float(x)\n    if u==\"BTC\":\n        ans += x*380000.0\n    else:\n        ans += x\nprint(ans)", "passed": true, "time": 0.28, "memory": 14168.0, "status": "done"}, {"code": "n = int(input())\ntotal = 0\nfor i in range(n):\n    value, currency = input().split()\n    if currency == 'JPY':\n        total += float(value)\n    else:\n        total += float(value) * 380000\nprint(total)", "passed": true, "time": 0.14, "memory": 14380.0, "status": "done"}, {"code": "n = int(input())\nlist_bonus = [[s for s in input().split()] for j in range(0, n)]\nans = 0.0\nfor i in range(0, n):\n    if list_bonus[i][1] == \"JPY\":\n        ans += float(list_bonus[i][0])\n    else:\n        ans += float(list_bonus[i][0]) * 380000.0\nprint(ans)", "passed": true, "time": 0.14, "memory": 14092.0, "status": "done"}, {"code": "n = int(input())\n\nj, b = 0, 0\nfor _ in range(n):\n    x, y = input().split()\n    x = float(x)\n    if y == 'JPY':\n        j += x\n    else:\n        b += x\nprint(j + b*380000)", "passed": true, "time": 0.14, "memory": 14304.0, "status": "done"}, {"code": "n = int(input())\nans = 0\nfor i in range(n):\n    x, u = input().split()\n    x = float(x)\n    if u == \"JPY\":\n        ans += x\n    else:\n        ans += x*380000\nprint(ans)", "passed": true, "time": 0.15, "memory": 14236.0, "status": "done"}, {"code": "n=int(input())\nm=[list(map(str,input().split())) for i in range(n)]\n\ncnt=0\n\nfor i in range(n):\n  m[i][0]=float(m[i][0])\n  if m[i][1]=='BTC':\n    m[i][0]*=380000.0\n  cnt+=m[i][0]\n\nprint(cnt)", "passed": true, "time": 0.14, "memory": 14088.0, "status": "done"}, {"code": "N = int(input())\n\nans = 0.0\nr = 380000.0\nfor i in range(N):\n  x, u = input().split()\n  x = float(x)\n  if u == 'JPY': ans += x\n  if u == 'BTC': ans += r * float(x)\n    \nprint(ans)", "passed": true, "time": 0.15, "memory": 14128.0, "status": "done"}, {"code": "n = int(input())\n\nmoney_sum = 0\n\nfor i in range(n):\n    x,u = input().split()\n    x = float(x)\n    if u == \"JPY\":\n        money_sum += x\n    else:\n        money_sum += x*380000\nprint(money_sum)", "passed": true, "time": 0.24, "memory": 14240.0, "status": "done"}, {"code": "N = int(input())\n\n# \u3084\u308b\u3060\u3051\nans = 0.0\nfor i in range(N):\n  x, u = input().split()\n  x = float(x)\n  if u == 'JPY': ans += x\n  if u == 'BTC': ans += 380000.0 * x\n    \nprint(ans)", "passed": true, "time": 0.15, "memory": 14148.0, "status": "done"}, {"code": "N = int(input())\n\nJPY = 0\nBTC = 0\nfor i in range(N):\n\ta, b = input().split()\n\tif b == 'JPY':\n\t\tJPY += float(a)\n\telse:\n\t\tBTC += float(a)\nprint(JPY + 380000.0 * BTC)", "passed": true, "time": 0.14, "memory": 14308.0, "status": "done"}, {"code": "n = int(input())\nres = 0.0\nfor _ in range(n):\n    x, u = input().split()\n    x = float(x)\n    res += x if u == 'JPY' else x * 380000.0\nprint(res)\n", "passed": true, "time": 0.14, "memory": 14376.0, "status": "done"}, {"code": "def resolve():\n    n = int(input())\n    s = 0\n    for _ in range(n):\n        x, u = input().split()\n        if u == 'BTC':\n            s += float(x) * 380000\n        else:\n            s += float(x) * 1\n    print(s)\nresolve()", "passed": true, "time": 0.14, "memory": 14328.0, "status": "done"}, {"code": "N = int(input())\n\nans = 0\nfor i in range(N):\n    x, u = map(str,input().split())\n    x = float(x)\n\n    if u == \"JPY\":\n        ans += x\n    else:\n        ans += x * 380000.0\n\nprint(ans)", "passed": true, "time": 0.14, "memory": 14192.0, "status": "done"}, {"code": "n = int(input())\nans = 0.0\nrate = 380000.0\nfor i in range(n):\n  a, b = input().split()\n  if b == \"JPY\":\n    ans += float(a)\n  else:\n    ans += (float(a)*rate)\nprint(ans)", "passed": true, "time": 0.14, "memory": 14236.0, "status": "done"}, {"code": "n = int(input())\nc = 0\nfor i in range(n):\n    y, t = input().split()\n    if t == 'BTC':\n        yen = float(y)*380000.0\n    else:\n        yen = float(y)\n    c += yen\n\nprint(c)", "passed": true, "time": 0.15, "memory": 14108.0, "status": "done"}, {"code": "N=int(input())\nxu=[]\nfor i in range(N):\n    xu.append(list(map(str,input().split())))\na=0\nfor i in range(N):\n    if xu[i][1]=='JPY':\n        a+=float(xu[i][0])\n    if xu[i][1]=='BTC':\n        a+=float(xu[i][0])*(380000.0)\nprint(a)", "passed": true, "time": 0.14, "memory": 14260.0, "status": "done"}, {"code": "N = int(input())\nmoneys = [tuple(map(str, input().split())) for _ in range(N)]\nrate = 380000\n\ntotal = 0\nfor money in moneys:\n    x, u = money\n    x = float(x)\n    if u == 'JPY':\n        total += x\n    else:\n        total += x * rate\n\nprint(total)\n\n", "passed": true, "time": 0.14, "memory": 14308.0, "status": "done"}, {"code": "n = int(input())\na = [list(input().split()) for _ in range(n)]\n\nans = 0\n\nfor i in range(n):\n    if a[i][1] == 'BTC':\n        ans += float(a[i][0]) * 380000\n    else:\n        ans += float(a[i][0])\n\nprint(ans)", "passed": true, "time": 0.14, "memory": 14112.0, "status": "done"}, {"code": "N=int(input())\nl=[0]*N \n \nfor i in range(N):\n\tx,y=map(str,input().split())\n\tl[i] = float(x)\n\tif y == \"BTC\":\n\t\t l[i] *= 380000.0\n\nans = sum(l)\nprint(ans)", "passed": true, "time": 0.14, "memory": 14296.0, "status": "done"}, {"code": "N=int(input())\nans=0\nfor i in range(N):\n\tx,u=map(str, input().split())\n\tif u==\"BTC\":\n\t\tans+=float(x)*380000\n\telse:\n\t\tans+=float(x)\n\t#print(ans)\n\nprint(ans)", "passed": true, "time": 0.14, "memory": 14340.0, "status": "done"}, {"code": "import sys\nlines = [s.rstrip(\"\\n\") for s in sys.stdin.readlines()]\nn, = [int(num) for num in lines.pop(0).split(\" \")]\ndef iter_value_and_unit():\n    for line in lines:\n        value, unit = line.split(\" \")\n        value = float(value)\n        if unit == \"BTC\":\n            yield 380000.0 * value\n        else:\n            yield value\n\nprint((sum(iter_value_and_unit())))\n", "passed": true, "time": 0.14, "memory": 14284.0, "status": "done"}, {"code": "# coding: utf-8\n\nnum = int(input())\ntotal = 0\nfor i in range(num):\n    money, code = input().split()\n    if code == \"JPY\":\n        total += float(money)\n    elif code == \"BTC\":\n        total += float(money) * 380000.0\nprint(total)", "passed": true, "time": 0.14, "memory": 14228.0, "status": "done"}, {"code": "n = int(input())\nxu = [list(input().split()) for i in range(n)]\nans = 0\nfor i in range(n) :\n    xu[i][0] = float(xu[i][0])\n    if xu[i][1] == \"JPY\" :\n        ans += xu[i][0]\n\n    else :\n        ans += xu[i][0]*380000\n\nprint(ans)\n", "passed": true, "time": 0.14, "memory": 14116.0, "status": "done"}]