mirror of
https://github.com/tiennm99/codeforces.git
synced 2026-06-09 06:13:28 +00:00
23 lines
362 B
C#
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);
|
|
}
|
|
}
|
|
}
|