Given the task definition and input, reply with output. The task is to generate the correct answer for a given math problem.

Problem: a ranch has both horses and ponies . exactly 3 / 10 of the ponies have horseshoes , and exactly 5 / 8 of the ponies with horseshoes are from iceland . if there are 4 more horses than ponies , what is the minimum possible combined number of horses and ponies on the ranch ?
164