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