#include <iostream>
#include <string>
using namespace std;
/* run this program using the console pauser or add your own getch, system("pause") or input loop */

int main(int argc, char** argv) 
{
	char a[10];
	int r, l;
	l=0;
	r=0;
	string b;
	cin>>b;
	int n= b.length();
	a[0]=b[0];
	for (int i=1; i<n; i++)
	{
	if(b[i]!=b[i-1])
		{
		for (int j=0; j<=l; j++)
		{
		if (a[j]==b[i])
			{
			r++;
			l++;
			a[l]=b[i];
			}
		}
		
		
		}		
	
	
	
	}
cout<<r;
	
	
	return 0;
}