The $40 is divided into 1 part for Justin + 3 parts for Joshua = 4 parts.
So each part is equal to $40/4 = $<<40/4=10>>10.
Therefore, Joshua's share is $10 x 3 = $<<10*3=30>>30.
#### 30