import std.functional,
       std.algorithm,
       std.container,
       std.typetuple,
       std.typecons,
       std.bigint,
       std.string,
       std.traits,
       std.array,
       std.range,
       std.stdio,
       std.conv;

alias min = binaryFun!"a < b ? a : b";

void main() {
  long[] NM = readln.chomp.split.to!(long[]);
  long N = NM[0],
      M = NM[1];
  Tuple!(long, long)[] AB;

  foreach (_; 0..N) {
    long[] _AB = readln.chomp.split.to!(long[]);
    AB ~= tuple(_AB[0], _AB[1]);
  }

  AB.sort!((a, b) => a[0] < b[0]);

  long ans;
  long have;

  foreach (ab; AB) {
    long a = ab[0],
        b = ab[1];
    long t = min(M - have, b);
    ans += a * t;
    have += t;
  }

  writeln(ans);
}