N=int(input())
S=input()
S=list(S)

count1=0
count2=0

for i in range(N):
    if S[i]=='#':
        count1+=1
    elif S[i]=='.':
        count2+=1

if count1==0 or count2==0:
    print('0')
else:
    if count1<count2:
        print(count1)
    elif count1>count2:
        print(count2)
    else:
        print(count1)