string text = Console.ReadLine(); //leemos la entrada
char temp = 'a'; //caracter temporal diferente a cualquier usado
int numero = 0;
for (int i = 0; i < text.Length; i++) //bucle con tantas repeticiones como caracteres hemos leido
{
if (temp != text[i]) //si el temporar es distinto entonces:
{
numero++; //sumamos 1
temp = text[i]; //guardamos el char actual para compararlo con el siguiente
}
}
Console.WriteLine(numero); // resultado
Console.ReadKey();