#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, s = 0;
  cin >> n;
  int a[n], p[n];
  for (int i = 0; i < n; i++) cin >> a[i] >> p[i];
  int min = 101;
  for (int i = 0; i < n; i++) {
    if (p[i] < min) min = p[i];
    s = s + a[i] * min;
  }
  cout << s << endl;
  return 0;
}
