n = int(input())
s = list(input())
b = 0
w = 0
w2 ,b2 =0,0
for i in range(n):
    if s[i] != ".":
        b += 1
    else:
        w += 1
for i in range(n):
    if s[i] == ".":
        w2 +=1
    else:
        break
for j in range(n-1,-1,-1):
    if s[j] != ".":
        b2 +=1
    else:
        break

print(min(b-b2,w-w2))