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