n = int(input())
s = input()
t = list(s)
a = 0
b = 0
for i in range(s.find("#"), n):
    if t[i]==".":
        a=a+1
for j in range(0, s.rfind(".")+1):
    if t[j]=="#":
        b=b+1     
print(min(a,b))