program tenka1_2019_c
    use,intrinsic :: iso_fortran_env
    implicit none
    integer(int32):: n,i,cl,cr,ans
    character(:),allocatable:: s

    read*, n
    allocate(character(n):: s)
    read*, s(:)
    cl = 0
    cr = 0
    do i=1,n
        if (s(i:i) == '.') cr=cr+1
    end do

    ans = cl+cr

    do i=1,n
        if (s(i:i) == '.') then
            cr=cr-1
        else
            cl=cl+1
        end if
        ans = min(ans,cl+cr)
    end do

    print'(i0)', ans
end program tenka1_2019_c