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

#.#
tilnow = []
tilnow.append(S[0])
ans = 0

for i,s in enumerate(S[1:]):
    if s == ".":
        if tilnow[i-1] == "#":
            ans+=1
            tilnow.append("#")
        else:
            tilnow.append(".")
    else:
        tilnow.append("#")
print(ans)
