#include <bits/stdc++.h>
int main() {
  int n;
  int a[100005], p[100005];
  int minday;
  int minw;
  int ans = 0;
  while (scanf("%d", &n) != EOF) {
    ans = 0;
    int i, j;
    minw = 9999999;
    for (i = 1; i <= n; i++) {
      scanf("%d%d", &a[i], &p[i]);
      if (p[i] < minw) minw = p[i];
      ans += minw * a[i];
    }
    printf("%d\n", ans);
  }
  return 0;
}
