#include <bits/stdc++.h>
using namespace std;
const int inf = (int)1e9;
int main() {
  int n;
  cin >> n;
  int pr = inf;
  int ans = 0;
  for (int i = 0; i < n; ++i) {
    int a, p;
    cin >> a >> p;
    pr = min(pr, p);
    ans += a * pr;
  }
  cout << ans << endl;
  return 0;
}
