Option Strict On
Module Module1

    Sub Main()
        Dim n As Integer = Convert.ToInt32(Console.ReadLine())
        Dim S As String = Console.ReadLine()
        Dim white As Integer = 0
        For i As Integer = 0 To n - 1
            If Mid(S, i + 1, 1) = "." Then
                white += 1
            End If
        Next
        Dim leftblack As Integer = 0
        Dim sum As Integer = n
        For i As Integer = 0 To n - 1
            If Mid(S, i + 1, 1) = "#" Then
                leftblack += 1
            Else
                white -= 1
            End If
            If sum > leftblack + white Then
                sum = leftblack + white
            End If

        Next
        Console.WriteLine(sum)
        Console.ReadLine()
    End Sub

End Module