#include <bits/stdc++.h>
using namespace std;
const long long int LL_INF = 0x3f3f3f3f3f3f3f;
int main() {
  int n;
  scanf("%d", &n);
  int ans = 0;
  int mn = 105, t, need;
  for (int i = 0; i < n; ++i) {
    scanf("%d", &need);
    scanf("%d", &t);
    mn = min(t, mn);
    ans += mn * need;
  }
  printf("%d\n", ans);
  return 0;
}
