import java.util.*; public class Run { public static void main (String arg[]) { Scanner scan = new Scanner(System.in); int N = scan.nextInt(); long C,D; long count = 0; for (int i = 0; i < N; i++) { C = scan.nextLong(); if (C%2 == 0) C /= 2; else C = C/2 + 1; D = scan.nextLong(); count += C * D; } System.out.println(count); } }