#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i;
  cin >> n;
  long long a, b;
  vector<pair<long long, long long>> v;
  for (i = 0; i < n; i++) {
    cin >> a >> b;
    v.push_back({a, b});
  }
  int min = 200;
  long long s = 0;
  for (i = 0; i < v.size(); i++) {
    if (v[i].second < min) {
      min = v[i].second;
      s += v[i].second * v[i].first;
    } else {
      s += v[i].first * min;
    }
  }
  cout << s << endl;
  return 0;
}
