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