n=STDIN.gets.to_i ans=0 n.times do |i| a,b=STDIN.gets.split(" ") a=a.to_i b=b.to_i ans+=((a+1)/2*b) end puts ans