Count the Number of Good Subsequences