#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, sum = 0, kg, cost, cost1 = 101;
  cin >> n;
  while (n--) {
    cin >> kg >> cost;
    cost = cost < cost1 ? cost : cost1;
    sum += (cost * kg);
    cost1 = cost;
  }
  cout << sum;
  return 0;
}
