In a locality there are x cows and 2 dogs. If total number of their legs are 24, then the number of cows are equal to