In a batch of 30 apples, 1/6 are too small and 1/3 are not ripe. The others are perfect. Calculate the number of perfect apples.