import sys
input = sys.stdin.readline
n,k = list(map(int,input().split()))
a = [None]*n
for i in range(n):
    a[i] = list(map(int,input().split()))
a.sort(reverse=True,key=lambda x:x[1])
l = 0
ma = 0
for x in a:
    beau = x[1]
    l += x[0]
    ma = max(beau*l,ma)
print(ma)