n, m = list(map(int, input().split()))

e = [tuple(map(int, input().split())) for _ in range(n)]

e.sort()  # 金額昇順

ans = 0

rest = m

for a, b in e:

    use = min(rest, b)

    ans += use * a

    rest -= use

    if rest == 0:

        break

print(ans)

def main():

    from operator import itemgetter

    import sys

    input = sys.stdin.readline



    N, M = list(map(int, input().split()))



    ds = []

    for _ in range(N):

        a, b = list(map(int, input().split()))

        ds.append((a, b))



    ds.sort(key=itemgetter(0))



    rest = M

    mi = 0

    for a, b in ds:

        use = min(rest, b)

        mi += a * use

        rest -= use

        if not use:

            break



    print(mi)





if __name__ == '__main__':

    main()



# import sys

#

# sys.setrecursionlimit(10 ** 7)

#

# input = sys.stdin.readline

# rstrip()

# int(input())

# map(int, input().split())

n, m = list(map(int, input().split()))
e = [tuple(map(int, input().split())) for _ in range(n)]
e.sort()  # 金額昇順
ans = 0
rest = m
for a, b in e:
    use = min(rest, b)
    ans += use * a
    rest -= use
    if rest == 0:
        break
print(ans)

def main():
    from operator import itemgetter
    import sys

    input = sys.stdin.readline
    N, M = list(map(int, input().split()))
    ds = []
    for _ in range(N):
        a, b = list(map(int, input().split()))
        ds.append((a, b))
    ds.sort(key=itemgetter(0))
    rest = M
    mi = 0
    for a, b in ds:
        use = min(rest, b)
        mi += a * use
        rest -= use
        if not use:
            break
    print(mi)


if __name__ == "__main__":
    main()
# import sys
#
# sys.setrecursionlimit(10 ** 7)
#
# input = sys.stdin.readline
# rstrip()
# int(input())
# map(int, input().split())

-n, m = list(map(int, input().split())) -e = [tuple(map(int, input().split())) for _ in range(n)] -e.sort()  # 金額昇順 -ans = 0 -rest = m -for a, b in e: -    use = min(rest, b) -    ans += use * a -    rest -= use -    if rest == 0: -        break -print(ans) +def main(): +    from operator import itemgetter +    import sys + +    input = sys.stdin.readline +    N, M = list(map(int, input().split())) +    ds = [] +    for _ in range(N): +        a, b = list(map(int, input().split())) +        ds.append((a, b)) +    ds.sort(key=itemgetter(0)) +    rest = M +    mi = 0 +    for a, b in ds: +        use = min(rest, b) +        mi += a * use +        rest -= use +        if not use: +            break +    print(mi) + + +if __name__ == "__main__": +    main() +# import sys +# +# sys.setrecursionlimit(10 ** 7) +# +# input = sys.stdin.readline +# rstrip() +# int(input()) +# map(int, input().split())