N = int(input())
S = str(input())
 
n1 = S.count(".")
n2 = S.count("#")
s1 = S.split("#")
print(s1)
n3 = N
for i in range (N):
    tco = S[:i].count("#") + S[i:].count(".")
    if n3 > tco:
        n3 = tco

print(min(n1,n2,n3))