A local farmer has sheep and goats in his farm. The total number of animals is 49. If the number of goats is 12 less than twice the number of sheep, how many goats does the farmer have?