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