#include <bits/stdc++.h>
using namespace std;
int a[100001], p[100001];
int main() {
  int min = 1000, sum = 0, n, i, j;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d %d", &a[i], &p[i]);
    if (p[i] < min) {
      min = p[i];
    }
    sum += a[i] * min;
  }
  printf("%d\n", sum);
  return 0;
}
