import std.stdio, std.range, std.conv, std.string;
import std.algorithm.comparison, std.algorithm.iteration, std.algorithm.mutation, std.algorithm.searching, std.algorithm.setops, std.algorithm.sorting;

struct List{
    long A;
    long B;
}

void main()
{
    int[] input = readln().split.to!(int[]);
    int N = input[0];
    int M = input[1];
    List[] list = [];
    foreach(int i; 0..N)
    {
        auto a = readln().split.to!(int[]);
        auto l = List();
        l.A = a[0];
        l.B = a[1];
        list~=l;
    }
    list.sort!((a,b)=>a.A<b.A)();
    long res = 0;
    long count = 0;
    foreach(i; 0..N)
    {
        auto a = list[i];
        auto need = M - count;
        if(need <= a.B)
        {
            res += need * a.A;
            break;
        }else{
            res += a.B * a.A;
            count += a.B;
        }
    }
    writeln(res);
}