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

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

index=0
while(s[index]=="."):
    index+=1
if(count1 < s[index:].count(".")):
    print(s[index:].count("."))
else:
    print(min(count1, count2))
