```java
class Solution {
public int buyChoco(int[] prices, int money) {
int min = Integer.MAX_VALUE;
int secondMin = min;
for (int price : prices) {
if (min > price) {
secondMin = min;
min = price;
} else if (secondMin > price) {
secondMin = price;
}
}
return min + secondMin > money ? money : money - (min + secondMin);
}
}
```