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