import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner s=new Scanner(System.in); int sum=0; int n=s.nextInt(); while(n--!=0){ int w=s.nextInt(); int score=s.nextInt(); sum+=w*score; } if(sum<=0)sum=0; System.out.println(sum); s.close(); } }