#include <bits/stdc++.h>
int main() {
  int a[100001], p[100001], n, i, min = 101, total = 0;
  scanf("%d", &n);
  for (i = 0; i < n; i++) scanf("%d %d", &a[i], &p[i]);
  for (i = 0; i < n; i++) {
    if (min > p[i]) {
      min = p[i];
    }
    total = total + min * a[i];
  }
  printf("%d\n", total);
  return 0;
}
