A farmer grows 196 pounds of potatoes. He sells them to a grocer who divides them into 5 pound and 2-pound bags. If the grocer uses the same number of 5 and 2-pound bags, how many bags of each did he use?