Let d the number of drama videos, c the number of comedy videos and a the number of action videos.
If the cost per video (independently of the genre) is $4, then, for the total cost of the videos Gretchen payed, you can write:
total = 4d + 4c + 4a
Now, based on the given table, you have:
d = 2
c = 5
a = 3
By replacing the previous values into the expression for total, and by simplifying, you obtain:
total = 4(2) + 4(5) + 4(3)
total = 8 + 20 + 12
total = 40
Hence, Gretchen payed $40 for the videos