#include <bits/stdc++.h>
using namespace std;
int n, mn = 200, c = 0, x, y, i;
int main() {
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> x >> y;
    mn = min(mn, y);
    c += x * mn;
  }
  cout << c;
}
