#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  vector<int> v(n);
  vector<int> pre(n);
  int mn = INT_MAX;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> v[i] >> x;
    mn = min(mn, x);
    pre[i] = mn;
  }
  int sum = 0;
  for (int i = 0; i < n; i++) sum += (v[i] * pre[i]);
  cout << sum;
  return 0;
}
