A farmer had a daughter who spoke in riddles. One day the child was asked to count the number of goats and the number of sheep in the barnyard. She returned and said, "Twice the number of heads is 76 less than the number of legs." How many goats were in the barnyard?

I tried to solve this problem for an hour. nothing! HELP!!!