n = int(input())
s = input()
from collections import Counter

a = 0
e = 0
for i in range(n):
    if s[i] == ".":
        a += 1
    else:
        break
for i in range(n):
    if s[n-1-i] == "#":
        e += 1
    else:
        break        

        
c = Counter(s[a:n])
d = Counter(s[:n-e])

print(min(c["."],d["#"]))