#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a[100005], temp, minn, ans;
  while (scanf("%d", &n) != EOF) {
    minn = 1000;
    ans = 0;
    for (int i = 0; i < n; i++) {
      scanf("%d%d", &a[i], &temp);
      minn = min(minn, temp);
      ans += minn * a[i];
    }
    printf("%d\n", ans);
  }
  return 0;
}
