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