The light travels at speed of [tex]c=3.0\cdot 10^8 m/s[/tex], so it's very huge compared to the speed of sound, therefore we can assume that the light coming from the thunderstorm arrives to us istantaneously.
This means that 50 seconds is the time the sound of the thunder takes to arrive to us. So, using the basic relationship between space and time:
[tex]S=vt[/tex]
We find the distance covered by the sound in 50 seconds, i.e. how far is the thunderstorm:
[tex]S=(332 m/s)(50 s)=16600 m=16.6 km[/tex]