#include <bits/stdc++.h>
using namespace std;
int a[100000], p[100000];
int main() {
  int n;
  while (cin >> n) {
    for (int i = int(0); i < int(n); i++) {
      cin >> a[i] >> p[i];
    }
    int ans = 0, lo = 1000000000;
    for (int i = int(0); i < int(n); i++) {
      lo = min(lo, p[i]);
      ans += lo * a[i];
    }
    cout << ans << endl;
  }
  return 0;
}
