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