#include <bits/stdc++.h>
using namespace std;
long long int a[100011], p[100011];
int main() {
  long long int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i] >> p[i];
  }
  long long int mn = 999999999;
  long long int cnt = 0;
  for (int i = 1; i <= n; i++) {
    if (p[i] < mn) {
      mn = p[i];
    }
    cnt += mn * a[i];
  }
  cout << cnt;
  return 0;
}
