John has 5 boxes of sweets. One group of boxes has 5 sweets in each box. The second group of boxes has 4 sweets in each box. John has a total of 22 sweets. How many boxes of each type John has?