We will have the following:
First, we find the distance it traveled upward:
[tex]d_u=5m[/tex]Now, we find the distance it traveled to the ground:
[tex]d_d=5m+2m\Rightarrow d_d=7m[/tex]Now, the total distance is:
[tex]d_T=d_u+d_{\text{d}}\Rightarrow d_T=5m+7m[/tex][tex]\Rightarrow d_T=12m[/tex]So, the ball traveled a total of 12 meters.