#include <bits/stdc++.h>
using namespace std;
const int oo = int(2e9) + 9;
const double eps = 1e-9;
const double pi = 3.14159265358979323846264338327950;
int main() {
  int n;
  cin >> n;
  int mn = oo;
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    int a, p;
    cin >> a >> p;
    mn = min(p, mn);
    ans = ans + mn * a;
  }
  cout << ans << endl;
  return 0;
}
