#include <bits/stdc++.h>
using namespace std;
int a[100002], p[100002];
int main() {
  ios_base::sync_with_stdio(false);
  int n, mincost = 100000;
  long long int cost = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    cin >> p[i];
  }
  for (int i = 0; i < n; i++) {
    if (p[i] < mincost) {
      mincost = p[i];
    }
    cost = cost + (a[i] * mincost);
  }
  cout << cost;
  return 0;
}
