__author__ = 'Zlobober'
n = int(raw_input())
A = []
P = []
for i in range(n):
a, p = map(int, raw_input().split())
A.append(a)
P.append(p)
mn = 142
ans = 0
for i in range(n):
mn = min(mn, P[i])
ans += A[i] * mn
print ans
X19hdXRob3JfXyA9ICdabG9ib2JlcicKbiA9IGludChyYXdfaW5wdXQoKSkKQSA9IFtdClAgPSBbXQpmb3IgaSBpbiByYW5nZShuKToKICAgIGEsIHAgPSBtYXAoaW50LCByYXdfaW5wdXQoKS5zcGxpdCgpKQogICAgQS5hcHBlbmQoYSkKICAgIFAuYXBwZW5kKHApCm1uID0gMTQyCmFucyA9IDAKZm9yIGkgaW4gcmFuZ2Uobik6CiAgICBtbiA9IG1pbihtbiwgUFtpXSkKICAgIGFucyArPSBBW2ldICogbW4KcHJpbnQgYW5z