# -*- coding: utf-8 -*- #No.146 試験監督(1) __author__ = 'yuuki' N = input() a =[] for i in xrange(N): a.append(map(int,raw_input().split())) zyukou = 0 for i in xrange(N): if a[i][0] % 2 == 0: zyukou += (a[i][0] / 2) * a[i][1] else: zyukou += (a[i][0] / 2 + 1) * a[i][1] print zyukou