count_subpeptides method to count the number of subpeptides