
# coding: utf-8
# Your code here!

n = int(input())
 
lines = list(input())
 
 
count = 0
for line in lines:
    if line == ".":
        count+=1
    else:
        break
 
total = lines.count('.')
 
ans1 = total-count
 
count = 0
lines = lines[::-1]
for line in lines:
    if line == "#":
        count+=1
    else:
        break
total = lines.count('#')
ans2 = total-count

print(min(ans1,ans2))