#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, j, k, l, m = 0, n;
  cin >> n;
  int a[n], p[n];
  for (i = 0; i < n; i++) {
    cin >> a[i] >> p[i];
  }
  m += a[0] * p[0];
  l = p[0];
  for (i = 1; i < n; i++) {
    if (p[i] < l) {
      l = p[i];
    }
    m += a[i] * l;
  }
  cout << m << endl;
  return 0;
}
