calculate number of ways for money change