#include <bits/stdc++.h>
using namespace std;
int main() {
  int n = 0;
  cin >> n;
  int a[n], p[n];
  for (int i = 0; i < n; i++) {
    int num1 = 0, num2 = 0;
    cin >> num1 >> num2;
    a[i] = num1;
    p[i] = num2;
  }
  int money = a[0] * p[0], min = p[0];
  for (int i = 1; i < n; i++) {
    if (min > p[i]) min = p[i];
    money += (a[i] * min);
  }
  cout << money << "\n";
  return 0;
}
