#include <bits/stdc++.h>
int main() {
  int a, b, w, c, s = 0, i;
  scanf("%d", &a);
  for (i = 0; i < a; i++) {
    scanf("%d %d", &b, &c);
    if (i == 0)
      w = c;
    else if (w > c)
      w = c;
    s = s + (b * w);
  }
  printf("%d", s);
}
