#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  int n, a, b, p = 110, sum = 0;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a >> b;
    if (b < p) p = b;
    sum += p * a;
  }
  cout << sum;
  return 0;
}
