#include <bits/stdc++.h>
using namespace std;
int main() {
  int t, money = 0, min = INT_MAX;
  cin >> t;
  for (int i = 0; i < t; i++) {
    int a, p;
    cin >> a >> p;
    if (min > p) {
      min = p;
    }
    money = money + min * a;
  }
  cout << money;
}
