Find largest S-distance.