N = int(input())
S = input()

if N == 1 :
    ans = 0
elif "#" not in S[:-1] :
    ans = 0
else :
    s = S.find("#")
    a = S[s:].count(".")
    b = S[:-1].count("#")
    ans = min(a,b)
print(ans)

