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