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

namespace Tenka1_2019
{
    class C
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            string s = Console.ReadLine();
            int ans = 0;
            bool count = false;
            for (int i = 0; i < n; i++)
            {
                if (s.Substring(i, 1) == "#") { count = true; }
                if (count) {
                    if (s.Substring(i, 1) == ".") { ans++; }
                }
            }
            Console.WriteLine(ans);
        }
    }
}
