#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n = ({
    long long a;
    scanf("%lld", &a);
    a;
  });
  long long arr[n + 1];
  long long buy_from[n + 1];
  long long mini = 1 << 29;
  for (long i = 0; i <= n - 1; i += 1) {
    arr[i] = ({
      long long a;
      scanf("%lld", &a);
      a;
    });
    long long p = ({
      long long a;
      scanf("%lld", &a);
      a;
    });
    mini = min(mini, p);
    buy_from[i] = mini;
  }
  long long sum = 0;
  for (long i = 0; i <= n - 1; i += 1) sum += arr[i] * buy_from[i];
  cout << sum;
  return 0;
}
