calculating amount of stone needed - Search