#include <bits/stdc++.h>
using namespace std;
int* a = new int[100000];
int* p = new int[100000];
int main() {
  int n, min_price;
  long long sum = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i] >> p[i];
  }
  min_price = p[0];
  for (int i = 0; i < n; i++) {
    if (min_price > p[i]) {
      min_price = p[i];
    }
    sum += a[i] * min_price;
  }
  cout << sum << endl;
}
