#include <bits/stdc++.h>
using namespace std;
int n, kq;
int a[100005], p[100005];
int main() {
  cin >> n;
  kq = 0;
  for (int i = 1; i <= n; i++) cin >> a[i] >> p[i];
  int tg = p[1];
  kq = kq + a[1] * p[1];
  for (int i = 2; i <= n; i++)
    if (p[i] > tg)
      kq = kq + a[i] * tg;
    else {
      tg = p[i];
      kq = kq + a[i] * p[i];
    }
  cout << kq;
}
