using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace slova
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            string s = Console.ReadLine();
            int b = 0;
            char a = s[0];
            for (int i=1; i< n; i++)
            {
                if (s[i] == a) b++;
                a = s[i];
            }
            int x = 0;
            if (b > 0) x = 2 * b;
            else x = 1;
            Console.WriteLine(x);
        }
    }
}