#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<map>
#include<set>
#include<queue>
#include<vector>
#define IL inline
#define re register
#define LL long long
#define ULL unsigned long long
#ifdef TH
#define debug printf("Now is %d\n",__LINE__);
#else
#define debug
#endif
using namespace std;

template<class T>inline void read(T&x)
{
	char ch=getchar();
	int fu;
	while(!isdigit(ch)&&ch!='-') ch=getchar();
	if(ch=='-') fu=-1,ch=getchar();
	x=ch-'0';ch=getchar();
	while(isdigit(ch)){x=x*10+ch-'0';ch=getchar();}
	x*=fu;
}
inline int read()
{
	int x=0,fu=1;
	char ch=getchar();
	while(!isdigit(ch)&&ch!='-') ch=getchar();
	if(ch=='-') fu=-1,ch=getchar();
	x=ch-'0';ch=getchar();
	while(isdigit(ch)){x=x*10+ch-'0';ch=getchar();}
	return x*fu;
}
int G[55];
template<class T>inline void write(T x)
{
	int g=0;
	if(x<0) x=-x,putchar('-');
	do{G[++g]=x%10;x/=10;}while(x);
	for(int i=g;i>=1;--i)putchar('0'+G[i]);putchar('\n');
}

int main()
{
	char ch=getchar();
	if(getchar()==ch&&getchar()==ch) cout<<"Won";
	else cout<<"Lost";
	return 0;
}


#include<bits/stdc++.h>
#define rep(i,n) for(int i = 0 ; i < (n); ++i)
using namespace std ;
using ll=long long ;
using P=pair<int,int> ;

const int mod=1000000007;
const int N=1e5 ;
const int INF=1001001001;

void solve(){

string s ;
cin>>s;

int n=s.length() ;
//cout<<n<<"\n" ;

ll ans=0 ;
map<char,int> mp ;
mp[s.back()]=1 ;

for(int i=n-2;i>=0;i--){

	mp[s[i]]++ ;

	if(s[i]==s[i+1]){
		ans+=n-i-mp[s[i]] ;
		mp=map<char,int>() ;
		mp[s[i]]=n-i ;

	}

//	cout<<i<<" "<<ans<<"\n" ;
}

cout<<ans ;




}	

int main(){
 
	#ifndef ONLINE_JUDGE
		freopen("input.txt","r",stdin) ;
		freopen("output.txt","w",stdout) ;
    #endif 

		cin.tie(0);
		cout.tie(0);
		ios_base::sync_with_stdio(false);  

		int y ;

		y=1 ;
		//cin>>y ;

		while(y--){
 
			solve() ;
			
		}

		return 0 ;
}