Danial went to a fruit stall that sells apples, mangoes, and papayas. Each apple costs $3$ RM ,each mango costs $4$ RM , and each papaya costs $5$ RM . He bought at least one of each fruit, and paid exactly $50$ RM. What is the maximum number of fruits that he could have bought?
1. **Define the variables:**
   Let \( a \) be the number of apples, \( m \) be the number of mangoes, and \( p \) be the number of papayas.

2. **Set up the cost equation:**
   Each apple costs 3 RM, each mango costs 4 RM, and each papaya costs 5 RM. The total cost is 50 RM.
   \[
   3a + 4m + 5p = 50
   \]

3. **Account for the minimum purchase requirement:**
   Since Danial bought at least one of each fruit, we have:
   \[
   a \geq 1, \quad m \geq 1, \quad p \geq 1
   \]

4. **Subtract the minimum cost of one of each fruit:**
   The minimum cost for one of each fruit is:
   \[
   3 \times 1 + 4 \times 1 + 5 \times 1 = 3 + 4 + 5 = 12 \text{ RM}
   \]
   Therefore, the remaining amount to be spent is:
   \[
   50 - 12 = 38 \text{ RM}
   \]

5. **Maximize the number of fruits:**
   To maximize the number of fruits, we need to minimize the cost per fruit. The cheapest fruit is the apple, costing 3 RM each. Let's see how many additional apples can be bought with the remaining 38 RM:
   \[
   \left\lfloor \frac{38}{3} \right\rfloor = 12 \text{ apples}
   \]
   The cost of these 12 additional apples is:
   \[
   12 \times 3 = 36 \text{ RM}
   \]
   The remaining amount after buying these apples is:
   \[
   38 - 36 = 2 \text{ RM}
   \]

6. **Adjust for the remaining amount:**
   Since there are no fruits costing 2 RM, we need to adjust our purchase. We can reduce the number of apples by 1 (which frees up 3 RM) and use this amount to buy another fruit. Let's reduce the apples by 1 and add a papaya (which costs 5 RM):
   \[
   12 - 1 = 11 \text{ apples}
   \]
   The cost of 11 apples is:
   \[
   11 \times 3 = 33 \text{ RM}
   \]
   The remaining amount is:
   \[
   38 - 33 = 5 \text{ RM}
   \]
   We can buy 1 additional papaya with this 5 RM.

7. **Calculate the total number of fruits:**
   The total number of fruits is:
   \[
   1 \text{ apple} + 1 \text{ mango} + 2 \text{ papayas} + 11 \text{ additional apples} = 1 + 1 + 2 + 11 = 15 \text{ fruits}
   \]

The final answer is \(\boxed{15}\).