#include <bits/stdc++.h>
using namespace std;
set<long long>::iterator it;
vector<long long>::iterator it1;
struct stc {
  int fir, sc;
} input[1000];
bool comp(stc a, stc b) { return a.fir < b.fir; }
pair<int, int> pi[100010];
int main() {
  int n, a, p, i, mn, res;
  while (cin >> n) {
    mn = 101;
    for (i = 1; i <= n; i++) {
      cin >> a >> p;
      mn = (p < mn ? p : mn);
      pi[i - 1] = make_pair(a, mn);
      mn = pi[i - 1].second;
    }
    res = 0;
    for (i = 0; i < n; i++) {
      res += pi[i].first * pi[i].second;
    }
    cout << res << endl;
  }
  return 0;
}
