#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a, b, minn = 1000;
  long long res = 0;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d%d", &a, &b);
    minn = min(minn, b);
    res += minn * a;
  }
  printf("%d", res);
  return 0;
}
