Johann baked 24 cookies for a picnic with his friends. Of the 10 friends he invited, 7 friends were able to attend the picnic. If Johann gave each of his friends the same number of cookies and had 3 cookies left for himself, how many did each friend get? How can you check your answer?