You may find the following formulas useful:
If you don't get this in 2 tries, you can get a hint.
Hint: