Files
codeforces/cs/266A.cs
T
2023-03-02 20:58:03 +07:00

23 lines
362 B
C#

using System;
namespace problem_266A
{
public class problem_266A
{
public static void Main(string[] args)
{
int n = int.Parse(Console.ReadLine());
char[] a = Console.ReadLine().ToCharArray();
int c = 0;
for (int i = 1; i < n; i++)
{
if (a[i] == a[i - 1])
{
c++;
}
}
Console.Write(c);
}
}
}