import sys
import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline

input_n = lambda: int(readline())
input_nn = lambda: map(int, readline().split())
input_s = lambda: readline().rstrip().decode('utf-8')


def main():
    N, M = input_nn()
    AB = sorted([list(input_nn()) for _ in range(N)])

    m = M
    ans = 0
    for i in range(N):
        if AB[i][1] < m:
            ans += AB[i][0] * AB[i][1]
            m -= AB[i][1]
        else:
            ans += AB[i][0] * m
            break

    print(ans)


if __name__ == '__main__':
    main() import sys sys import numpy as np numpy read = sys.stdin.buffer.read read sys.stdin.buffer.read sys.stdin.buffer sys.stdin sys stdin buffer read readline = sys.stdin.buffer.readline readline sys.stdin.buffer.readline sys.stdin.buffer sys.stdin sys stdin buffer readline input_n = lambda: int(readline()) input_n lambda: int(readline()) int(readline()) int readline() readline input_nn = lambda: map(int, readline().split()) input_nn lambda: map(int, readline().split()) map(int, readline().split()) map int readline().split() ().split () readline split input_s = lambda: readline().rstrip().decode('utf-8') input_s lambda: readline().rstrip().decode('utf-8') readline().rstrip().decode('utf-8') ().rstrip().decode ().rstrip() ().rstrip () readline rstrip decode 'utf-8' def main():
    N, M = input_nn()
    AB = sorted([list(input_nn()) for _ in range(N)])

    m = M
    ans = 0
    for i in range(N):
        if AB[i][1] < m:
            ans += AB[i][0] * AB[i][1]
            m -= AB[i][1]
        else:
            ans += AB[i][0] * m
            break

    print(ans) main N, M = input_nn() N input_nn() input_nn M list(input_nn()) for _ in range(N) for _ in range(N) _ range(N) range N for _ in range(N) list(input_nn()) list input_nn() input_nn AB = sorted([list(input_nn()) for _ in range(N)]) AB sorted([list(input_nn()) for _ in range(N)]) sorted [list(input_nn()) for _ in range(N)] m = M m M ans = 0 ans 0 for i in range(N):
        if AB[i][1] < m:
            ans += AB[i][0] * AB[i][1]
            m -= AB[i][1]
        else:
            ans += AB[i][0] * m
            break

     i range(N) range N if AB[i][1] < m:
            ans += AB[i][0] * AB[i][1]
            m -= AB[i][1]
        else:
            ans += AB[i][0] * m
            break

     AB[i][1] < m AB[i][1] [i] AB i 1 m ans += AB[i][0] * AB[i][1] ans AB[i][0] * AB[i][1] AB[i][0] [i] AB i 0 AB[i][1] [i] AB i 1 m -= AB[i][1] m AB[i][1] [i] AB i 1 ans += AB[i][0] * m ans AB[i][0] * m AB[i][0] [i] AB i 0 m break print(ans) print ans if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main input_nn = lambda: map(int, readline().split()) lambda: map(int, readline().split()) input_nn input_n = lambda: int(readline()) lambda: int(readline()) input_n read = sys.stdin.buffer.read sys.stdin.buffer.read read def main():
    N, M = input_nn()
    AB = sorted([list(input_nn()) for _ in range(N)])

    m = M
    ans = 0
    for i in range(N):
        if AB[i][1] < m:
            ans += AB[i][0] * AB[i][1]
            m -= AB[i][1]
        else:
            ans += AB[i][0] * m
            break

    print(ans) def main():
    N, M = input_nn()
    AB = sorted([list(input_nn()) for _ in range(N)])

    m = M
    ans = 0
    for i in range(N):
        if AB[i][1] < m:
            ans += AB[i][0] * AB[i][1]
            m -= AB[i][1]
        else:
            ans += AB[i][0] * m
            break

    print(ans) main readline = sys.stdin.buffer.readline sys.stdin.buffer.readline readline input_s = lambda: readline().rstrip().decode('utf-8') lambda: readline().rstrip().decode('utf-8') input_s
import sys
import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline

input_n = lambda: int(readline())
input_nn = lambda: map(int, readline().split())
input_s = lambda: readline().rstrip().decode('utf-8')


def main():
    N, M = input_nn()
    AB = sorted([list(input_nn()) for _ in range(N)])

    m = M
    ans = 0
    for i in range(N):
        if AB[i][1] < m:
            ans += AB[i][0] * AB[i][1]
            m -= AB[i][1]
        else:
            ans += AB[i][0] * m
            break

    print(ans)


if __name__ == '__main__':
    main()
