#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a, b, m = 101, s = 0;
  cin >> n;
  while (n--) {
    cin >> a >> b;
    if (b <= m) {
      m = b;
    }
    s += m * a;
  }
  cout << s;
}
