N = int(input())
S = input()
B,W =0,0
hoge = 0
for c in S[0:N]:
    if c=="#":
        hoge += 1
    if c == ".":
        B += hoge
        hoge = 0
        if B > 0:
            W += 1
print(min(B,W))
