17 lines
335 B
C++
17 lines
335 B
C++
|
#include <iostream>
|
||
|
|
||
|
using namespace std;
|
||
|
|
||
|
int main(){
|
||
|
std::string input;
|
||
|
std::cin >> input;
|
||
|
long total = 0;
|
||
|
for(int i = 0; i < input.size(); i++){
|
||
|
int next_index = (i + 1) % input.size();
|
||
|
if(input[i] == input[next_index]){
|
||
|
total += input[i] - '0';
|
||
|
}
|
||
|
}
|
||
|
std::cout << total;
|
||
|
}
|