N=int(input())
S=input()
b=0
w_2=0
w=0
f_b=-1
for i in range(N):
    if S[i]=='.':
        w+=1
        if f_b!=-1:
            w_2+=1
    else:
        b+=1
        if f_b==-1:
            f_b=i
            b_2+=1
print(min(N-w,N-b,w_2))