#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> meat(n);
  vector<int> price(n);
  vector<int> minimum_price(n);
  int min = 10000007;
  int i;
  for (i = 0; i < n; i++) {
    cin >> meat[i] >> price[i];
    if (price[i] < min) min = price[i];
    minimum_price[i] = min;
  }
  long long int sum = 0;
  for (i = 0; i < n; i++) sum = minimum_price[i] * meat[i] + sum;
  cout << sum << endl;
}
