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

S = list(S)
scount = S.count(".")
kcount = S.count("#")

if scount < kcount:

    for i in range(len(S)-1):
        if (S[i]=="#")and(S[i+1]=="."):
            count += 1
            S[i+1] == "#"
else :
    for i in range(len(S)-1):
        if (S[i]=="#")and(S[i+1]=="."):
            count += 1
            S[i] == "."

print(count)
