N, M = [int(x) for x in input().split()]

AB = [[int(x) for x in input().split()] for _ in range(N)]

AB.sort(key=lambda x: x[0])



s = 0

for ab in AB:

    if ab[1] > M:

        s += M*ab[0]

        break

    else:

        s += ab[0]*ab[1]

        M -= ab[1]



print(s)

#!/usr/bin/env python3

import sys





def solve(N: int, M: int, A: "List[int]", B: "List[int]"):

    AB = sorted(list(range(N)), key=lambda x: A[x])



    s = 0

    for i in AB:

        if B[i] > M:

            s += M*A[i]

            break

        else:

            s += A[i]*B[i]

            M -= B[i]



    print(s)

    return





# Generated by 1.1.3 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)

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

    M = int(next(tokens))  # type: int

    A = [int()] * (N)  # type: "List[int]"

    B = [int()] * (N)  # type: "List[int]"

    for i in range(N):

        A[i] = int(next(tokens))

        B[i] = int(next(tokens))

    solve(N, M, A, B)





if __name__ == '__main__':

    main()

N, M = [int(x) for x in input().split()]
AB = [[int(x) for x in input().split()] for _ in range(N)]
AB.sort(key=lambda x: x[0])
s = 0
for ab in AB:
    if ab[1] > M:
        s += M * ab[0]
        break
    else:
        s += ab[0] * ab[1]
        M -= ab[1]
print(s)

#!/usr/bin/env python3
import sys


def solve(N: int, M: int, A: "List[int]", B: "List[int]"):
    AB = sorted(list(range(N)), key=lambda x: A[x])
    s = 0
    for i in AB:
        if B[i] > M:
            s += M * A[i]
            break
        else:
            s += A[i] * B[i]
            M -= B[i]
    print(s)
    return


# Generated by 1.1.3 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
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
    M = int(next(tokens))  # type: int
    A = [int()] * (N)  # type: "List[int]"
    B = [int()] * (N)  # type: "List[int]"
    for i in range(N):
        A[i] = int(next(tokens))
        B[i] = int(next(tokens))
    solve(N, M, A, B)


if __name__ == "__main__":
    main()

-N, M = [int(x) for x in input().split()] -AB = [[int(x) for x in input().split()] for _ in range(N)] -AB.sort(key=lambda x: x[0]) -s = 0 -for ab in AB: -    if ab[1] > M: -        s += M * ab[0] -        break -    else: -        s += ab[0] * ab[1] -        M -= ab[1] -print(s) +#!/usr/bin/env python3 +import sys + + +def solve(N: int, M: int, A: "List[int]", B: "List[int]"): +    AB = sorted(list(range(N)), key=lambda x: A[x]) +    s = 0 +    for i in AB: +        if B[i] > M: +            s += M * A[i] +            break +        else: +            s += A[i] * B[i] +            M -= B[i] +    print(s) +    return + + +# Generated by 1.1.3 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template) +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 +    M = int(next(tokens))  # type: int +    A = [int()] * (N)  # type: "List[int]" +    B = [int()] * (N)  # type: "List[int]" +    for i in range(N): +        A[i] = int(next(tokens)) +        B[i] = int(next(tokens)) +    solve(N, M, A, B) + + +if __name__ == "__main__": +    main()