import java.util.ArrayList; import java.util.List; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); List input = new ArrayList<>(); while (sc.hasNext()) { input.add(sc.nextLine()); } System.out.println(solve(input)); sc.close(); } public static int solve(List input) { int t = 0; input.remove(0); for (int i = 0; i < input.size(); i++) { int s = Integer.valueOf(input.get(i).split(" ")[0]); int k = Integer.valueOf(input.get(i).split(" ")[1]); if (s % 2 == 0) { t += (s / 2) * k; } else { t += (s + 1) / 2 * k; } } return t; } }