BEGIN {
	data_msg_size = 8.0
	rate = 0
	size = 0
}
{
	for (i = 0; i < 10; ++i)
		if (substr($i, 2, 1) == ".")
			break;
	if (i < 10) {
		if ($(i+1) == "yes") {
		rate += $i
		size += $i * $(i+2)
		}
		if ($(i+3) == "yes") {
			rate += $i
			if ($(i+4) == "***") {
				size += $i * (4 + data_msg_size)
			}
			else {
				size += $i * $(i+4)
			}	
		}
	}
}		
END {
	printf("average message rate (m) = %1.5f%%\n", rate)
	printf("average message size (B) = %2.5f\n", size/rate)
}
