Write Python code to solve the task:
A substring is a string of characters that is contained in another string. For example, the substrings of "abcdef" could be "abc", "bc", "cdef", "e" and so on. But, "bca", "ace", and "g" are not substrings of "abcdef". 

Your task is to count the number of non-empty substrings possible of a given string such that all characters in that substring are same. If two substrings contains same alphabets but appear at different positions in that given string, they are still considered to be different. 

Input

A single string without spaces

Output

a single integer denoting the number of substrings as described above

Constraints
length of string will be between 1 and 100
all characters of string will be small case alphabets only

SAMPLE INPUT
xxxyx

SAMPLE OUTPUT
8

Explanation

four occurrences of substring "x"

one occurrence of substring "y"

two occurrences of substring "xx"  

one occurrence of substring "xxx"

= total 8
user
Step 1: Iterate through each character in the given string and count the number of occurrences of each character. 
Step 2: For each character, calculate the number of substrings that consist of only that character. This can be done by taking the count of that character and adding it to the total number of substrings. 
Step 3: Print the total number of substrings as the output. 
```python
# Step 4: We take the input string as 's'
s = input()

# Step 5: Initialize a variable 'count' to keep track of the total number of substrings
count = 0

# Step 6: Iterate through each character in the input string 's'
for i in range(len(s)):
    # Step 7: For each character, increment the count by the number of occurrences of that character
    count += s.count(s[i])

# Step 8: Print the total count as the output
print(count)
```
assistant
Your answer is wrong.
Your solution is incorrect because you are counting the total occurrences of each character in the string, which will include duplicate counts. The problem statement asks for substrings with only same characters, so you should be looking for continuous characters that are same. Keep a count of these and for each such sequence, if the count is 'n', the number of substrings will be n*(n+1)/2. You will have to revise your plan to handle these.
user
Step 1: Iterate through each character in the given string and check if the current character is the same as the previous character. 
Step 2: If it is, increment a counter variable by 1. If it is not, calculate the number of substrings that can be formed with the previous character and update the count variable accordingly. Reset the counter variable to 1. 
Step 3: After the loop, calculate the number of substrings that can be formed with the last character and update the count variable accordingly.
Step 4: Print the count variable as the output.
```python
# Step 5: We take the input string as 's'
s = input()

# Step 6: Initialize a variable 'count' to keep track of the total number of substrings
count = 0

# Step 7: Initialize a variable 'curr_count' to keep track of the count of continuous same characters
curr_count = 1

# Step 8: Iterate through each character in the input string 's'
for i in range(1, len(s)):
    # Step 9: Check if the current character is the same as the previous character
    if s[i] == s[i-1]:
        # Step 10:  If it is, increment the 'curr_count' variable by 1
        curr_count += 1
    else:
        # Step 11:  If it is not, calculate the number of substrings that can be formed with the previous character
        # Step 12:  and update the 'count' variable accordingly
        count += curr_count * (curr_count + 1) // 2
        # Step 13:  Reset the 'curr_count' variable to 1
        curr_count = 1

# Step 14:  Calculate the number of substrings that can be formed with the last character
# Step 15:  and update the 'count' variable accordingly
count += curr_count * (curr_count + 1) // 2

# Step 16:  Print the total count as the output
print(count)
```
assistant