z = 0 for _ in range(int(input())): x, y = map(int, input().split()) z += (x+1)//2 * y print(z)