import sys
import math
import decimal
read = sys.stdin.read
readline = sys.stdin.buffer.readline
INF = float('inf')


def main():
    N = int(readline())
    JPY = 0
    BTC = 0
    for _ in range(N):
        x, u = readline().decode('utf-8').strip().split()
        if u == 'JPY':
            JPY += int(x)
        else:
            BTC += decimal.Decimal(x)

    ans = JPY + BTC*380000
    print(ans)
if __name__ == '__main__':
    main() import sys sys import math math import decimal decimal read = sys.stdin.read read sys.stdin.read sys.stdin sys stdin read readline = sys.stdin.buffer.readline readline sys.stdin.buffer.readline sys.stdin.buffer sys.stdin sys stdin buffer readline INF = float('inf') INF float('inf') float 'inf' def main():
    N = int(readline())
    JPY = 0
    BTC = 0
    for _ in range(N):
        x, u = readline().decode('utf-8').strip().split()
        if u == 'JPY':
            JPY += int(x)
        else:
            BTC += decimal.Decimal(x)

    ans = JPY + BTC*380000
    print(ans) main N = int(readline()) N int(readline()) int readline() readline JPY = 0 JPY 0 BTC = 0 BTC 0 for _ in range(N):
        x, u = readline().decode('utf-8').strip().split()
        if u == 'JPY':
            JPY += int(x)
        else:
            BTC += decimal.Decimal(x)

     _ range(N) range N x, u = readline().decode('utf-8').strip().split() x readline().decode('utf-8').strip().split() ().decode('utf-8').strip().split ().decode('utf-8').strip() ().decode('utf-8').strip ().decode('utf-8') ().decode () readline decode 'utf-8' strip split u if u == 'JPY':
            JPY += int(x)
        else:
            BTC += decimal.Decimal(x)

     u == 'JPY' u 'JPY' JPY += int(x) JPY int(x) int x BTC += decimal.Decimal(x) BTC decimal.Decimal(x) decimal.Decimal decimal Decimal x ans = JPY + BTC*380000 ans JPY + BTC*380000 JPY BTC*380000 BTC 380000 print(ans) print ans if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main INF = float('inf') float('inf') INF read = sys.stdin.read sys.stdin.read read readline = sys.stdin.buffer.readline sys.stdin.buffer.readline readline def main():
    N = int(readline())
    JPY = 0
    BTC = 0
    for _ in range(N):
        x, u = readline().decode('utf-8').strip().split()
        if u == 'JPY':
            JPY += int(x)
        else:
            BTC += decimal.Decimal(x)

    ans = JPY + BTC*380000
    print(ans) def main():
    N = int(readline())
    JPY = 0
    BTC = 0
    for _ in range(N):
        x, u = readline().decode('utf-8').strip().split()
        if u == 'JPY':
            JPY += int(x)
        else:
            BTC += decimal.Decimal(x)

    ans = JPY + BTC*380000
    print(ans) main
import sys
import math
import decimal
read = sys.stdin.read
readline = sys.stdin.buffer.readline
INF = float('inf')


def main():
    N = int(readline())
    JPY = 0
    BTC = 0
    for _ in range(N):
        x, u = readline().decode('utf-8').strip().split()
        if u == 'JPY':
            JPY += int(x)
        else:
            BTC += decimal.Decimal(x)

    ans = JPY + BTC*380000
    print(ans)
if __name__ == '__main__':
    main()
