#include <bits/stdc++.h>
using namespace std;
const int nmax = 111111;
int main() {
  int n = 0;
  int a[nmax], p[nmax];
  scanf("%d\n", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d%d\n", &a[i], &p[i]);
  }
  int res = 0;
  int price = 100000000;
  for (int i = 0; i < n; i++) {
    price = min(price, p[i]);
    res += (a[i] * price);
  }
  cout << res;
  return 0;
}
