First, lets find the number of gallons needed for 2727 miles. We can do this by dividing the miles by the miles per gallon, this way we have an number in gallons. So...
2727 / 27 = 101Gallons
Now, we know we need 101 gallons, and since each gallon is 4.04, we can find how much it is, by multiplying the amount times the number needed So...
101 * 4.04 = 408.04