import sys


stdin = sys.stdin
def ns(): return stdin.readline().rstrip()
def ni(): return int(stdin.readline().rstrip())
def nm(): return map(int, stdin.readline().split())
def nl(): return list(map(int, stdin.readline().split()))


def main():
    n, m = nm()
    AB = [tuple(map(int, input().split())) for _ in range(n)]
    AB = sorted(AB, key=lambda x: x[0])
    num = 0
    ans = 0
    for a, b in AB:
        w_num = m - num
        if w_num <= b:
            num += w_num
            ans += w_num * a
            break
        else:
            num += b
            ans += b * a
    print(ans)


if __name__ == '__main__':
    main() import sys sys stdin = sys.stdin stdin sys.stdin sys stdin def ns(): return stdin.readline().rstrip() ns def ni(): return int(stdin.readline().rstrip()) ni def nm(): return map(int, stdin.readline().split()) nm def nl(): return list(map(int, stdin.readline().split())) nl def main():
    n, m = nm()
    AB = [tuple(map(int, input().split())) for _ in range(n)]
    AB = sorted(AB, key=lambda x: x[0])
    num = 0
    ans = 0
    for a, b in AB:
        w_num = m - num
        if w_num <= b:
            num += w_num
            ans += w_num * a
            break
        else:
            num += b
            ans += b * a
    print(ans) main n, m = nm() n nm() nm m tuple(map(int, input().split())) for _ in range(n) for _ in range(n) _ range(n) range n for _ in range(n) tuple(map(int, input().split())) tuple map(int, input().split()) map int input().split() ().split () input split AB = [tuple(map(int, input().split())) for _ in range(n)] AB [tuple(map(int, input().split())) for _ in range(n)] AB = sorted(AB, key=lambda x: x[0]) AB sorted(AB, key=lambda x: x[0]) sorted AB key=lambda x: x[0] key lambda x: x[0] x[0] x 0 x num = 0 num 0 ans = 0 ans 0 for a, b in AB:
        w_num = m - num
        if w_num <= b:
            num += w_num
            ans += w_num * a
            break
        else:
            num += b
            ans += b * a
     a b AB w_num = m - num w_num m - num m num if w_num <= b:
            num += w_num
            ans += w_num * a
            break
        else:
            num += b
            ans += b * a
     w_num <= b w_num b num += w_num num w_num ans += w_num * a ans w_num * a w_num a break num += b num b ans += b * a ans b * a b a print(ans) print ans if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main def nm(): return map(int, stdin.readline().split()) def nm(): return map(int, stdin.readline().split()) nm def ns(): return stdin.readline().rstrip() def ns(): return stdin.readline().rstrip() ns def ni(): return int(stdin.readline().rstrip()) def ni(): return int(stdin.readline().rstrip()) ni stdin = sys.stdin sys.stdin stdin def main():
    n, m = nm()
    AB = [tuple(map(int, input().split())) for _ in range(n)]
    AB = sorted(AB, key=lambda x: x[0])
    num = 0
    ans = 0
    for a, b in AB:
        w_num = m - num
        if w_num <= b:
            num += w_num
            ans += w_num * a
            break
        else:
            num += b
            ans += b * a
    print(ans) def main():
    n, m = nm()
    AB = [tuple(map(int, input().split())) for _ in range(n)]
    AB = sorted(AB, key=lambda x: x[0])
    num = 0
    ans = 0
    for a, b in AB:
        w_num = m - num
        if w_num <= b:
            num += w_num
            ans += w_num * a
            break
        else:
            num += b
            ans += b * a
    print(ans) main def nl(): return list(map(int, stdin.readline().split())) def nl(): return list(map(int, stdin.readline().split())) nl
import sys


stdin = sys.stdin
def ns(): return stdin.readline().rstrip()
def ni(): return int(stdin.readline().rstrip())
def nm(): return map(int, stdin.readline().split())
def nl(): return list(map(int, stdin.readline().split()))


def main():
    n, m = nm()
    AB = [tuple(map(int, input().split())) for _ in range(n)]
    AB = sorted(AB, key=lambda x: x[0])
    num = 0
    ans = 0
    for a, b in AB:
        w_num = m - num
        if w_num <= b:
            num += w_num
            ans += w_num * a
            break
        else:
            num += b
            ans += b * a
    print(ans)


if __name__ == '__main__':
    main()