#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int mini = 147, c = 0;
  for (int i = 0; i < n; ++i) {
    int a, p;
    cin >> a >> p;
    mini = min(mini, p);
    c += a * mini;
  }
  cout << c << "\n";
  return 0;
}
