n = int(input())
s = list(input())

count1 = s.count('.')
count2 = s.count('#')

index=0
while(True):
    if(index < n):
        if(s[index]=="."):
            index+=1
        else:
            break
    else:
        break
if(count1 > s[index:].count(".") and index!=n):
    print(s[index:].count("."))
else:
    print(min(count1, count2))
