n = int(input())
s = list(input())
a = 0
flag = 0
for i in range(n):
    if flag == 0 and s[i] == "#":
        flag = 1
        continue
    
    if flag == 1 and s[i]==".":
        a +=1

b = 0
m = 0
for i in reversed(range(n)):
    if m == 0 and s[i]==".":
        m = 1
        continue
    
    if m == 1 and s[i]== "#":
        b +=1
ans = min(a,b)
print(ans)