#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a, p, maxn = 1000;
  int cost = 0;
  cin >> n;
  while (n > 0) {
    cin >> a >> p;
    if (p < maxn) maxn = p;
    cost += maxn * a;
    n--;
  }
  cout << cost << endl;
  return 0;
}
