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