#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a, p, min1 = 999, sum = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a >> p;
    min1 = min(min1, p);
    sum += a * min1;
  }
  cout << sum;
  return 0;
}
