n = int(input())
S = input()
a = list(S)
b = list(S)
aa = list(S)
bb = list(S)
ans = 0
aans = 0
bns = 0
bbns = 0
for i in range(n-2,-1,-1):
    if a[i] == "#" and a[i+1] == ".":
        ans += 1
        a[i+1] = "#"

for i in range(n-2,-1,-1):
    if b[i] == "#" and b[i+1] == ".":
        bns += 1
        b[i] = "."

for i in range(n-1):
    if aa[i] == "#" and aa[i+1] == ".":
        aans += 1
        aa[i+1] == "#"

for i in range(n-1):
    if bb[i] == "#" and bb[i+1] == ".":
        bbns += 1
        bb[i] == "."
print(min(ans,aans,bns,bbns))