#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a[100000], p[100000], i, ans = 0, price = INT_MAX;
  scanf("%d", &n);
  for (i = 0; i < n; i++) scanf("%d %d", &a[i], &p[i]);
  for (i = 0; i < n; i++) {
    price = min(price, p[i]);
    ans += (a[i] * price);
  }
  printf("%d", ans);
  return 0;
}
