Look at the head. You will be able to see where the bolts go and be able to tell if the head is thicker or thinner at that spot and this will help determine how many of each you need.
For example, along the intake/exhaust side where the bolts go is thinner, so you need the shorter bolts for that location.