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