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