#include <bits/stdc++.h>
const long long MXN = 1e9 + 7;
using namespace std;
long long a, b, k1, k2, n, ans;
int main() {
  cin >> n;
  int a[100005];
  int p[100005];
  for (int i = 1; i <= n; i++) {
    cin >> a[i] >> p[i];
    if (i > 1) {
      p[i] = min(p[i], p[i - 1]);
    }
    ans += a[i] * p[i];
  }
  cout << ans;
  return 0;
}
