import sys
input = lambda: sys.stdin.readline().rstrip()

def main():
    n, m = map(int, input().split())
    drinks = list()
    ans = 0
    for _ in range(n):
        drinks.append(list(map(int, input().split())))
    drinks = sorted(drinks, key=lambda x: x[0])
    for drink in drinks:
        if drink[1] >= m:
            ans += drink[0] * m
            break
        else:
            ans += drink[0] * drink[1]
            m -= drink[1]
    print(ans)
            
if __name__ == '__main__':
    main() import sys sys input = lambda: sys.stdin.readline().rstrip() input lambda: sys.stdin.readline().rstrip() sys.stdin.readline().rstrip() sys.stdin.readline().rstrip sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline rstrip def main():
    n, m = map(int, input().split())
    drinks = list()
    ans = 0
    for _ in range(n):
        drinks.append(list(map(int, input().split())))
    drinks = sorted(drinks, key=lambda x: x[0])
    for drink in drinks:
        if drink[1] >= m:
            ans += drink[0] * m
            break
        else:
            ans += drink[0] * drink[1]
            m -= drink[1]
    print(ans)
             main n, m = map(int, input().split()) n map(int, input().split()) map int input().split() ().split () input split m drinks = list() drinks list() list ans = 0 ans 0 for _ in range(n):
        drinks.append(list(map(int, input().split())))
     _ range(n) range n drinks.append(list(map(int, input().split()))) drinks.append drinks append list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split drinks = sorted(drinks, key=lambda x: x[0]) drinks sorted(drinks, key=lambda x: x[0]) sorted drinks key=lambda x: x[0] key lambda x: x[0] x[0] x 0 x for drink in drinks:
        if drink[1] >= m:
            ans += drink[0] * m
            break
        else:
            ans += drink[0] * drink[1]
            m -= drink[1]
     drink drinks if drink[1] >= m:
            ans += drink[0] * m
            break
        else:
            ans += drink[0] * drink[1]
            m -= drink[1]
     drink[1] >= m drink[1] drink 1 m ans += drink[0] * m ans drink[0] * m drink[0] drink 0 m break ans += drink[0] * drink[1] ans drink[0] * drink[1] drink[0] drink 0 drink[1] drink 1 m -= drink[1] m drink[1] drink 1 print(ans) print ans if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main input = lambda: sys.stdin.readline().rstrip() lambda: sys.stdin.readline().rstrip() input def main():
    n, m = map(int, input().split())
    drinks = list()
    ans = 0
    for _ in range(n):
        drinks.append(list(map(int, input().split())))
    drinks = sorted(drinks, key=lambda x: x[0])
    for drink in drinks:
        if drink[1] >= m:
            ans += drink[0] * m
            break
        else:
            ans += drink[0] * drink[1]
            m -= drink[1]
    print(ans)
             def main():
    n, m = map(int, input().split())
    drinks = list()
    ans = 0
    for _ in range(n):
        drinks.append(list(map(int, input().split())))
    drinks = sorted(drinks, key=lambda x: x[0])
    for drink in drinks:
        if drink[1] >= m:
            ans += drink[0] * m
            break
        else:
            ans += drink[0] * drink[1]
            m -= drink[1]
    print(ans)
             main
import sys
input = lambda: sys.stdin.readline().rstrip()

def main():
    n, m = map(int, input().split())
    drinks = list()
    ans = 0
    for _ in range(n):
        drinks.append(list(map(int, input().split())))
    drinks = sorted(drinks, key=lambda x: x[0])
    for drink in drinks:
        if drink[1] >= m:
            ans += drink[0] * m
            break
        else:
            ans += drink[0] * drink[1]
            m -= drink[1]
    print(ans)
            
if __name__ == '__main__':
    main()