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

S = S[::-1]
while len(S) :
    if S[0] == "#" :
        S = S[1:]
    else :
        break

if len(S) :
    S = S[::-1]

    a = S.count("#")
    b = len(S) - a
    print(min(a,b))
else :
    ans = 0