N = int(input())
S = str(input())

S0 = S[0]
L = []
count = 1


for i in range(1,N):
    if S[i-1]!=S[i]:
        L.append(count)
        count =1

    else:
        count +=1
    if i ==N-1:
        L.append(count)

lenL=len(L)
Numw =0
Numb =0
Numx =0

if S0 == '.':
    if S[-1] =='.':
        for i in range(1,lenL):
            if i%2 == 0:
                Numw +=L[i]

            else: 
                Numb +=L[i]
        m=(min(Numw,Numb))

        tmp =float("inf")

        for k in range(len(L)):
            counter = 0
            for i in range(k):
                counter += L[2*i+1]
            for i in range(k,int(lenL/2)):
                counter +=L[2*i]
            tmp = min(tmp,counter)
        print(min(m,tmp))


    else:
        for i in range(1,len(L)-1):
            if i%2 ==0:
                Numw +=L[i]
            else:
                Numb +=L[i]
        m=(min(Numb,Numw))
        tmp =float("inf")

        for k in range(len(L)):
            counter = 0
            for i in range(k):
                counter += L[2*i+1]
            for i in range(k,int(lenL/2)-1):
                counter +=L[2*i]
            tmp = min(tmp,counter)
        print(min(m,tmp))
            

else:
    if S[-1]=='.':
        for i in range(len(L)):
            if i%2 ==0:
                Numb += L[i]
            else:
                Numw += L[i]
        m=(min(Numb,Numw))
        tmp =float("inf")

        for k in range(len(L)):
            counter = 0
            for i in range(k):
                counter += L[2*i]
            for i in range(k,int(lenL/2)-1):
                counter +=L[2*i+1]
            tmp = min(tmp,counter)
        print(min(m,tmp))

    else:
        for i in range(len(L)-1):
            if i%2 ==0:
                Numb += L[i]
            else:
                Numw += L[i]
        m=(min(Numb,Numw))
        tmp =float("inf")

        for k in range(len(L)):
            counter = 0
            for i in range(k):
                counter += L[2*i]
            for i in range(k,int(lenL/2)-1):
                counter +=L[2*i+1]
            tmp = min(tmp,counter)
        print(min(m,tmp))

