#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int ar[n], br[n];
  for (int i = 0; i < n; i++) {
    cin >> ar[i];
    cin >> br[i];
  }
  int p = INT_MAX;
  int sum = 0;
  for (int i = 0; i < n; i++) {
    if (br[i] < p) {
      p = br[i];
    }
    sum += p * ar[i];
  }
  cout << sum << endl;
  return 0;
}
