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

namespace AtCorder_C
{
    class Program
    {
        /// <summary>
        /// 
        /// </summary>
        /// <param name="args"></param>
        static void Main(string[] args)
        {
            var n = int.Parse(Console.ReadLine());
            var s = Console.ReadLine().Select(c => c == '#').ToArray();

            var h = s
                .Take(s.Length - 1)
                .Select((b, i) => b && !s.Skip(i + 1).First())
                .Count(b => b);

            Console.WriteLine(h);
        }
    }
}
