#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a[n], p[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i] >> p[i];
  }
  int leastPrice = INT_MAX, totalCost = 0, totalMeat = 0, currLeast = INT_MAX,
      currMeat = 0;
  for (int i = 1; i < n; i++) {
    if (p[i] > p[i - 1]) {
      p[i] = p[i - 1];
    }
  }
  for (int i = 0; i < n; i++) {
    totalCost += a[i] * p[i];
  }
  cout << totalCost << endl;
  return 0;
}
