program prob3
    implicit none
    integer::N,i,j,l,tmp,ans
    integer,allocatable::a(:)
    character(len=200005)::S
    read(*,*) N, S
    l = len_trim(S)
    allocate(a(l))
    if(S(1:1) .eq. ".") then
        a(1) = 0
    else
        a(1) = 1
    end if
    do i = 2, l
        if(S(i:i) .eq. ".") then
            a(i) = a(i-1)
        else
            a(i) = a(i-1) + 1
        end if
    end do

    ans = l
    do i = 1, l-1
        tmp = a(i) + (a(l) - a(i+1))
        ans = min(tmp,ans)
    end do
    ans = min(a(l),ans)
    ans = min(l-a(l),ans)
    write(*,*) ans
    stop
end program