#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, j;
  int ans = 0;
  int price = 1000;
  cin >> n;
  int a[n], p[n];
  for (i = 1; i <= n; i++) {
    cin >> a[i] >> p[i];
    price = min(price, p[i]);
    ans += a[i] * price;
  }
  cout << ans;
}
