You will need to cut three (3) pieces of foam:
The outside dimension will have to match the inside size of the book you purchased.
The Kindle Fire is 7.5×4.7×0.45 inch (190×120×11 mm).
The INSIDE deminsion length and width of two
of the pieces has to be ~ 1/8" larger than the Kindle so the Kindle will fit inside the foam with ~ 1/16" clearance. I used 7-5/8" X 4-3/4" as close enough.
I suggest you cut out a couple of cardboard templates and stack them to more or less equal to the Kindle's ~ 1/2" thickness as it will be useful later. By using your Kindle as a template, you can draw around it, cut out the cardboard, and use the cardbord template rather then a measuring device.
Cut out three pieces to the outside dimension necessary to match the size of the book you purchased to make a bottom, center, and top piece. You can use the pages as a cutting template for the outside edge of your foam.
Set the bottom piece aside.
Use your cardboard template and cut out the center of the other two pieces.
Set one piece aside as the top piece.
The last piece will be cut like a "U" with the length staying the same. In other words cut parallel to the length so the arms stay long.
If you mess up, don't worry, glue can fix a lot. I ended up gluing on strips so if you want to be frugral, you could do that too.