#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  vector<int> price(n, 0);
  vector<int> meat(n, 0);
  for (int i = 0; i < n; i++) {
    cin >> meat[i];
    cin >> price[i];
  }
  int bestPrice = 200;
  int cost = 0;
  for (int i = 0; i < n; i++) {
    bestPrice = min(bestPrice, price[i]);
    cost += bestPrice * meat[i];
  }
  cout << cost;
  return 0;
}
