N = int(input()) t = 0 for i in range(N): C, D = [int(i) for i in input().split()] t += round(C / 2) * D print(t)