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