Option Strict On
Module Module1

    Sub Main()
        Dim n As Integer = Convert.ToInt32(Console.ReadLine())
        Dim S As String = Console.ReadLine()
        Dim mini1 As Integer = 0
        For i As Integer = 0 To n - 1
            If Mid(S, i + 1, 1) = "." Then
                mini1 += 1

            End If
        Next
        Dim mini2 As Integer = 0
        For i As Integer = 0 To n - 1
            If Mid(S, i + 1, 1) = "#" Then
                mini2 += 1

            End If
        Next
        For i As Integer = 0 To n - 1
            If Mid(S, n - i, 1) = "#" Then
                mini2 -= 1
            Else
                Exit For
            End If
        Next


        If mini1 < mini2 Then
            Console.WriteLine(mini1)
        Else
            Console.WriteLine(mini2)
        End If
        Console.ReadLine()
    End Sub

End Module