N, M = map(int, input().split())
List = []
for _ in range(N):
    A, B = map(int, input().split())
    List.append((A, B))
List.sort(key=lambda x: x[0])
Res = 0
for i in range(N):
    A, B = List[i]
    if B <= M:
        M -= B
        Res += A*B
    else:
        Res += A*M
        break
print(Res) N, M = map(int, input().split()) N map(int, input().split()) map int input().split() ().split () input split M List = [] List [] for _ in range(N):
    A, B = map(int, input().split())
    List.append((A, B)) _ range(N) range N A, B = map(int, input().split()) A map(int, input().split()) map int input().split() ().split () input split B List.append((A, B)) List.append List append (A, B) A B List.sort(key=lambda x: x[0]) List.sort List sort key=lambda x: x[0] key lambda x: x[0] x[0] x 0 x Res = 0 Res 0 for i in range(N):
    A, B = List[i]
    if B <= M:
        M -= B
        Res += A*B
    else:
        Res += A*M
        break i range(N) range N A, B = List[i] A List[i] List i B if B <= M:
        M -= B
        Res += A*B
    else:
        Res += A*M
        break B <= M B M M -= B M B Res += A*B Res A*B A B Res += A*M Res A*M A M break print(Res) print Res List = [] [] List A, B = List[i] List[i] A M = map(int, input().split()) map(int, input().split()) M Res = 0 0 Res M -= B B M N, M = map(int, input().split()) map(int, input().split()) N A, B = map(int, input().split()) map(int, input().split()) A Res += A*M A*M Res Res += A*B A*B Res B = map(int, input().split()) map(int, input().split()) B B = List[i] List[i] B
N, M = map(int, input().split())
List = []
for _ in range(N):
    A, B = map(int, input().split())
    List.append((A, B))
List.sort(key=lambda x: x[0])
Res = 0
for i in range(N):
    A, B = List[i]
    if B <= M:
        M -= B
        Res += A*B
    else:
        Res += A*M
        break
print(Res)