Gravity slows the upward speed of any rising object by 9.8 m/s every second.
If the ball is tossed upward at 20 m/s, then it's at the top of its arc and its speed has dwindled to zero in (20/9.8) = 2.04 seconds.
During that time, its starting speed is 20 m/s and its ending speed is zero, so its AVERAGE speed all the way up is (1/2) (20 + 0) = 10 m/s .
Sailing upward for 2.04 seconds at an average speed of 10 m/s, the ball rises to (2.04 x 10) = <em>20.4 meters.</em>