#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n, mn = 101, sum = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int a, p;
    cin >> a >> p;
    mn = min(p, mn);
    sum += mn * a;
  }
  cout << sum << endl;
}
