Zachary and his children went into a bakery and he bought $15 worth of cupcakes and brownies. Each cupcake costs $3 and each brownies as cupcakes. Determine the number of cupcakes and the number of brownies that Zachary bought.