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