#!/usr/bin/env python3
import sys


def solve(N: int, x: "List[float]", u: "List[str]"):
    d = {'JPY': 1, 'BTC':380000}
    return sum(xx * d[uu] for xx, uu in zip(x, u))

# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    x = [float()] * (N)  # type: "List[float]"
    u = [str()] * (N)  # type: "List[str]"
    for i in range(N):
        x[i] = float(next(tokens))
        u[i] = next(tokens)
    print(solve(N, x, u))

def test():
    import doctest
    doctest.testmod()

if __name__ == '__main__':
    #test()
    main() import sys sys def solve(N: int, x: "List[float]", u: "List[str]"):
    d = {'JPY': 1, 'BTC':380000}
    return sum(xx * d[uu] for xx, uu in zip(x, u))

# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools solve d = {'JPY': 1, 'BTC':380000} d {'JPY': 1, 'BTC':380000} 'JPY' 'JPY' 1 'BTC' 'BTC' 380000 return sum(xx * d[uu] for xx, uu in zip(x, u)) sum(xx * d[uu] for xx, uu in zip(x, u)) sum xx * d[uu] xx d[uu] d uu N: int N x: "List[float]" x u: "List[str]" u def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    x = [float()] * (N)  # type: "List[float]"
    u = [str()] * (N)  # type: "List[str]"
    for i in range(N):
        x[i] = float(next(tokens))
        u[i] = next(tokens)
    print(solve(N, x, u)) main def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
     iterate_tokens for line in sys.stdin:
            for word in line.split():
                yield word
     line sys.stdin sys stdin for word in line.split():
                yield word
     word line.split() line.split line split yield word word tokens = iterate_tokens() tokens iterate_tokens() iterate_tokens N = int(next(tokens)) N int(next(tokens)) int next(tokens) next tokens x = [float()] * (N) x [float()] * (N) [float()] float() float N u = [str()] * (N) u [str()] * (N) [str()] str() str N for i in range(N):
        x[i] = float(next(tokens))
        u[i] = next(tokens)
     i range(N) range N x[i] = float(next(tokens)) x[i] x i float(next(tokens)) float next(tokens) next tokens u[i] = next(tokens) u[i] u i next(tokens) next tokens print(solve(N, x, u)) print solve(N, x, u) solve N x u def test():
    import doctest
    doctest.testmod() test import doctest doctest doctest.testmod() doctest.testmod doctest testmod if __name__ == '__main__':
    #test()
    main() __name__ == '__main__' __name__ '__main__' main() main def solve(N: int, x: "List[float]", u: "List[str]"):
    d = {'JPY': 1, 'BTC':380000}
    return sum(xx * d[uu] for xx, uu in zip(x, u))

# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools def solve(N: int, x: "List[float]", u: "List[str]"):
    d = {'JPY': 1, 'BTC':380000}
    return sum(xx * d[uu] for xx, uu in zip(x, u))

# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools solve def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    x = [float()] * (N)  # type: "List[float]"
    u = [str()] * (N)  # type: "List[str]"
    for i in range(N):
        x[i] = float(next(tokens))
        u[i] = next(tokens)
    print(solve(N, x, u)) def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    x = [float()] * (N)  # type: "List[float]"
    u = [str()] * (N)  # type: "List[str]"
    for i in range(N):
        x[i] = float(next(tokens))
        u[i] = next(tokens)
    print(solve(N, x, u)) main def test():
    import doctest
    doctest.testmod() def test():
    import doctest
    doctest.testmod() test
#!/usr/bin/env python3
import sys


def solve(N: int, x: "List[float]", u: "List[str]"):
    d = {'JPY': 1, 'BTC':380000}
    return sum(xx * d[uu] for xx, uu in zip(x, u))

# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    x = [float()] * (N)  # type: "List[float]"
    u = [str()] * (N)  # type: "List[str]"
    for i in range(N):
        x[i] = float(next(tokens))
        u[i] = next(tokens)
    print(solve(N, x, u))

def test():
    import doctest
    doctest.testmod()

if __name__ == '__main__':
    #test()
    main()
