Sponsored
Use these hints if you're stuck. Try solving on your own first.
Notice that the constraints are small enough for a brute force solution to pass.
Loop through all triplets, and count the ones that are good.
Solve with full IDE support and test cases