#include <stdio.h> 
/* Define trade_price */
double trade_price (double p, int n) {
  return p * n;
}
/* Define global arrays */
double price[100];
int number[100];
main ( ) {
  /* Declare various variables */
  int limit, counter;
  double sum = 0.0;
  /* Read numbers and stuff them into arrays */
  for (limit = 0; 
       2 == scanf ("%lf%i", &price[limit], &number[limit]);
       ++limit)
    ;
  /* Add all products of corresponding elements in the two arrays */
  for (counter = 0; counter < limit; ++counter)
    sum = sum + trade_price (price[counter], number[counter]);
  /* Display sum */
  printf ("The total value of the %i trades is %f.\n",
                                  limit,       sum);
}
