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