#include <bits/stdc++.h>
using namespace std;
int n, a, p, minimum, result;
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a >> p;
    if (i == 0 || minimum > p) minimum = p;
    result += (a * minimum);
  }
  cout << result;
}
