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)

Numw =0
Numb =0

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

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

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

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