def main():
    n, m = map(int, input().split())
    ab_list = [list(map(int, input().split())) for _ in range(n)]
    ab_list.sort(key=lambda x: x[0])
    ans = 0

    for ab in ab_list:
        a, b = ab[0], ab[1]
        if b <= m:
            ans += a * b
            m -= b
        else:
            ans += a * m
            break

    print(ans)


if __name__ == "__main__":
    main() def main():
    n, m = map(int, input().split())
    ab_list = [list(map(int, input().split())) for _ in range(n)]
    ab_list.sort(key=lambda x: x[0])
    ans = 0

    for ab in ab_list:
        a, b = ab[0], ab[1]
        if b <= m:
            ans += a * b
            m -= b
        else:
            ans += a * m
            break

    print(ans) main n, m = map(int, input().split()) n map(int, input().split()) map int input().split() ().split () input split m list(map(int, input().split())) for _ in range(n) for _ in range(n) _ range(n) range n for _ in range(n) list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split ab_list = [list(map(int, input().split())) for _ in range(n)] ab_list [list(map(int, input().split())) for _ in range(n)] ab_list.sort(key=lambda x: x[0]) ab_list.sort ab_list sort key=lambda x: x[0] key lambda x: x[0] x[0] x 0 x ans = 0 ans 0 for ab in ab_list:
        a, b = ab[0], ab[1]
        if b <= m:
            ans += a * b
            m -= b
        else:
            ans += a * m
            break

     ab ab_list a, b = ab[0], ab[1] a ab[0] ab 0 b ab[1] ab 1 if b <= m:
            ans += a * b
            m -= b
        else:
            ans += a * m
            break

     b <= m b m ans += a * b ans a * b a b m -= b m b ans += a * m ans a * m a m break print(ans) print ans if __name__ == "__main__":
    main() __name__ == "__main__" __name__ "__main__" main() main def main():
    n, m = map(int, input().split())
    ab_list = [list(map(int, input().split())) for _ in range(n)]
    ab_list.sort(key=lambda x: x[0])
    ans = 0

    for ab in ab_list:
        a, b = ab[0], ab[1]
        if b <= m:
            ans += a * b
            m -= b
        else:
            ans += a * m
            break

    print(ans) def main():
    n, m = map(int, input().split())
    ab_list = [list(map(int, input().split())) for _ in range(n)]
    ab_list.sort(key=lambda x: x[0])
    ans = 0

    for ab in ab_list:
        a, b = ab[0], ab[1]
        if b <= m:
            ans += a * b
            m -= b
        else:
            ans += a * m
            break

    print(ans) main
def main():
    n, m = map(int, input().split())
    ab_list = [list(map(int, input().split())) for _ in range(n)]
    ab_list.sort(key=lambda x: x[0])
    ans = 0

    for ab in ab_list:
        a, b = ab[0], ab[1]
        if b <= m:
            ans += a * b
            m -= b
        else:
            ans += a * m
            break

    print(ans)


if __name__ == "__main__":
    main()
