#include <bits/stdc++.h>
using namespace std;
int n, a, b, m = 101, cost = 0;
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a >> b;
    if (m > b) {
      m = b;
    }
    cost += m * a;
  }
  cout << cost << endl;
  return 0;
}
