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