A man is standing at a distance d from a cliff. He claps and hears the echo in 3 seconds. He moves 170 meters away from the cliff. At this position, the echo is heard after 4 seconds. Calculate the distance d.