Problems
Bad troubles at ACM ICPC
Bad troubles at ACM ICPC
Huseyn, Ibrahim and Alakbar participate at ACM ICPC competition. They try to solve the next problem:
You have a string with alphabetical characters and question marks. You can put any alphabetical character instead of any question mark. Count how many substrings can consist of only one symbol. ADA university's team feel themselves so bad (it is look like they have COVID-19) and you must help them to solve this problem.
Input
Contains a string, its length does not exceed 106
. The string consists of lowercase Latin letters and question marks.
Output
Print the answer to this problem.
Explanation
For the first example the strings that can consist of one symbol are: [1,1], [2,2], [3,3], [4,4], [2,3], [3,4].
Input example #1
ab?c
Output example #1
6
Input example #2
aa??b?c
Output example #2
19