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