#include <bits/stdc++.h>
int N, ans = 0;
int main() {
  scanf("%d", &N);
  int a, p, bp = 101;
  for (int i = 0; i < N; i++) {
    scanf("%d%d", &a, &p);
    bp = (p < bp ? p : bp);
    ans += a * bp;
  }
  printf("%d\n", ans);
  return 0;
}
