A gardener plants a row of eight trees chosen from three maples, two oaks, and four birches. In how many ways can he plant the row if:
trees of the same type have to be adjacent?