/f/{x+=$2;d+=a*$2}/n/{a+=$2}/u/{a-=$2}END{print x*d}