A substring of a string is a contiguous sequence of characters from the string.
For example, each of the strings "ab", "bcd", and "e" is a substring of "abcde".
On the other hand, "cba", "ace", and "f" are not substrings of "abcde".
The score of a string S is the number of ways in which we can select a non-empty substring of S such that all characters in the substring are the same.
If two substrings consist of the same letters but occur at different places in S, they are still considered different.
For example, the score of "aaaba" is 8: there are four occurrences of the substring "a", two occurrences of "aa", one occurrence of "aaa", and one of "b".
On her birthday, Maki got a String s from her friend Niko as a present.
Calculate and return its score.