Mara spent $2 x 2 = $<<2*2=4>>4 for riding the bumper car two times.
Riley spent $4 x 4 = $<<4*4=16>>16 for riding the space shuttle 4 times.
They spent $5 x 3 = $<<5*3=15>>15 each riding the Ferris wheel 3 times.
So, they spent a total of $15 x 2= $<<15*2=30>>30 riding the Ferris wheel.
Therefore the total amount they spent at the carnival is $4 + $16 + $30 = $<<4+16+30=50>>50.
#### 50