def solve():
    N, M = [int(i) for i in input().split()]
    D = [[int(i) for i in input().split()] for _ in range(N)]
    D.sort(key=lambda x: x[0])
    ans = 0
    for d in D:
        a, b = d
        ans += a * min(M, b)
        M -= min(M, b)
        if M == 0:
            print(ans)
            exit()

if __name__ == "__main__":
    solve() def solve():
    N, M = [int(i) for i in input().split()]
    D = [[int(i) for i in input().split()] for _ in range(N)]
    D.sort(key=lambda x: x[0])
    ans = 0
    for d in D:
        a, b = d
        ans += a * min(M, b)
        M -= min(M, b)
        if M == 0:
            print(ans)
            exit() solve int(i) for i in input().split() for i in input().split() i input().split() ().split () input split for i in input().split() int(i) int i N, M = [int(i) for i in input().split()] N [int(i) for i in input().split()] M [int(i) for i in input().split()] for _ in range(N) for _ in range(N) _ range(N) range N for _ in range(N) [int(i) for i in input().split()] D = [[int(i) for i in input().split()] for _ in range(N)] D [[int(i) for i in input().split()] for _ in range(N)] D.sort(key=lambda x: x[0]) D.sort D sort key=lambda x: x[0] key lambda x: x[0] x[0] x 0 x ans = 0 ans 0 for d in D:
        a, b = d
        ans += a * min(M, b)
        M -= min(M, b)
        if M == 0:
            print(ans)
            exit() d D a, b = d a d b ans += a * min(M, b) ans a * min(M, b) a min(M, b) min M b M -= min(M, b) M min(M, b) min M b if M == 0:
            print(ans)
            exit() M == 0 M 0 print(ans) print ans exit() exit if __name__ == "__main__":
    solve() __name__ == "__main__" __name__ "__main__" solve() solve def solve():
    N, M = [int(i) for i in input().split()]
    D = [[int(i) for i in input().split()] for _ in range(N)]
    D.sort(key=lambda x: x[0])
    ans = 0
    for d in D:
        a, b = d
        ans += a * min(M, b)
        M -= min(M, b)
        if M == 0:
            print(ans)
            exit() def solve():
    N, M = [int(i) for i in input().split()]
    D = [[int(i) for i in input().split()] for _ in range(N)]
    D.sort(key=lambda x: x[0])
    ans = 0
    for d in D:
        a, b = d
        ans += a * min(M, b)
        M -= min(M, b)
        if M == 0:
            print(ans)
            exit() solve
def solve():
    N, M = [int(i) for i in input().split()]
    D = [[int(i) for i in input().split()] for _ in range(N)]
    D.sort(key=lambda x: x[0])
    ans = 0
    for d in D:
        a, b = d
        ans += a * min(M, b)
        M -= min(M, b)
        if M == 0:
            print(ans)
            exit()

if __name__ == "__main__":
    solve()