Subsequences counting

I am unable to find the approach to count substrings.

maintain a global variable count and then when u cout the subsequence then get the count++
u will get the count