#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a, p, money, temp;
  cin >> a >> p;
  money = a * p;
  for (int i = 0; i < n - 1; i++) {
    cin >> a >> temp;
    if (temp < p) p = temp;
    money += a * p;
  }
  cout << money << "\n";
  return 0;
}
