now let xxxx represent a group say X also let YY represent another group =Y same for Z now the no of groups are X ,Y ,Z ,A ,B ,C ,D
now one letter can be selected in 13 ways two letters can be selected by 7p1 *6p1 *4c2*2c2* 3c2 similarly three letter can be selected 7p1*6p1* 5p1 *4c3 *1 *3c3
continuing in that way u will get 7 cases summating them u may get the answer not sure it will give or not