#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<int> kg, dam;
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    int a, b;
    cin >> a >> b;
    kg.push_back(a);
    dam.push_back(b);
  }
  int minimum = 105, taka = 0;
  for (int i = 0; i < n; i++) {
    if (minimum > dam[i]) minimum = dam[i];
    taka += kg[i] * minimum;
  }
  cout << taka << endl;
  return 0;
}
