Prove a formula for the number of edges of Kn,m,p

any help will be appreciated, thanks

it will take a long time if I do it by drawing, so if you know the formula please tell me.