get the number of ways with using minimal number of coins