import sys

def I(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def main():
    n, m = MI()
    a_b = [LI() for _ in range(n)]
    a_b.sort(key=lambda x:x[0])
    cnt = 0
    ans = 0
    for i in range(n):
        a = a_b[i][0]
        b = a_b[i][1]
        if cnt + b < m:
            cnt += b
            ans += a*b
        else:
            ans += a*(m - cnt)
            break
    print(ans)

if __name__ == '__main__':
    main() import sys sys def I(): return int(sys.stdin.readline()) I def MI(): return map(int, sys.stdin.readline().split()) MI def LI(): return list(map(int, sys.stdin.readline().split())) LI def main():
    n, m = MI()
    a_b = [LI() for _ in range(n)]
    a_b.sort(key=lambda x:x[0])
    cnt = 0
    ans = 0
    for i in range(n):
        a = a_b[i][0]
        b = a_b[i][1]
        if cnt + b < m:
            cnt += b
            ans += a*b
        else:
            ans += a*(m - cnt)
            break
    print(ans) main n, m = MI() n MI() MI m LI() for _ in range(n) for _ in range(n) _ range(n) range n for _ in range(n) LI() LI a_b = [LI() for _ in range(n)] a_b [LI() for _ in range(n)] a_b.sort(key=lambda x:x[0]) a_b.sort a_b sort key=lambda x:x[0] key lambda x:x[0] x[0] x 0 x cnt = 0 cnt 0 ans = 0 ans 0 for i in range(n):
        a = a_b[i][0]
        b = a_b[i][1]
        if cnt + b < m:
            cnt += b
            ans += a*b
        else:
            ans += a*(m - cnt)
            break
     i range(n) range n a = a_b[i][0] a a_b[i][0] [i] a_b i 0 b = a_b[i][1] b a_b[i][1] [i] a_b i 1 if cnt + b < m:
            cnt += b
            ans += a*b
        else:
            ans += a*(m - cnt)
            break
     cnt + b < m cnt + b cnt b m cnt += b cnt b ans += a*b ans a*b a b ans += a*(m - cnt) ans a*(m - cnt) a m - cnt m cnt break print(ans) print ans if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main def LI(): return list(map(int, sys.stdin.readline().split())) def LI(): return list(map(int, sys.stdin.readline().split())) LI def main():
    n, m = MI()
    a_b = [LI() for _ in range(n)]
    a_b.sort(key=lambda x:x[0])
    cnt = 0
    ans = 0
    for i in range(n):
        a = a_b[i][0]
        b = a_b[i][1]
        if cnt + b < m:
            cnt += b
            ans += a*b
        else:
            ans += a*(m - cnt)
            break
    print(ans) def main():
    n, m = MI()
    a_b = [LI() for _ in range(n)]
    a_b.sort(key=lambda x:x[0])
    cnt = 0
    ans = 0
    for i in range(n):
        a = a_b[i][0]
        b = a_b[i][1]
        if cnt + b < m:
            cnt += b
            ans += a*b
        else:
            ans += a*(m - cnt)
            break
    print(ans) main def I(): return int(sys.stdin.readline()) def I(): return int(sys.stdin.readline()) I def MI(): return map(int, sys.stdin.readline().split()) def MI(): return map(int, sys.stdin.readline().split()) MI
import sys

def I(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def main():
    n, m = MI()
    a_b = [LI() for _ in range(n)]
    a_b.sort(key=lambda x:x[0])
    cnt = 0
    ans = 0
    for i in range(n):
        a = a_b[i][0]
        b = a_b[i][1]
        if cnt + b < m:
            cnt += b
            ans += a*b
        else:
            ans += a*(m - cnt)
            break
    print(ans)

if __name__ == '__main__':
    main()