Rashi is going to plant 54 oak trees and 27 pine trees. She wants to plant them in such a way that all rows have the same number of trees and each row is made up of only one type of tree. What is the greatest number of trees Rashi can have in each row?