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