# How to solve the following problem?

Hi all. Recently I saw such a task. But problems arose with the decision. Would appreciate your help.

There are m men and w women. A deputation of exactly 3 people has to be formed from them. A deputation is diverse if and only if it contains at least one man and at least one woman. How many distinct ways are there to select a diverse deputation of 3 people? Two deputations are different if and only if one deputation has a member which the other does not have.
Find the number of ways to select a diverse deputation of 3 people.

Function Description
Complete the function diverseDeputation in the editor below. The function must return an integer which is the number of ways to select a diverse deputation from m men and w women.

Constraints
0 ≤ m, w ≤ 1000

/*
* Complete the 'diverseDeputation' function below.
*
* The function is expected to return an INTEGER.
* The function accepts the following parameters:
* 1. INTEGER m
* 2. INTEGER w
*/

function diverseDeputation(m, w) {