Who first calculated the distance between the sun and earth and when?

How did they calculate it?