n = int(input())
s = list(input())

#左からleft_count番目が黒い石

left_count = 1
for i in range(n):
    if s[i] == "#":
        break
    left_count = left_count + 1

#右からright_count番目が白い石

right_count = 1
for i in range(n):
    if s[-(i + 1)] == ".":
        break
    right_count = right_count + 1

w_count = 0
for i in range(n - left_count):
    if s[i + left_count] == ".":
        w_count = w_count + 1

b_count = 0
for i in range(n - right_count):
    if s[i] == "#":
        b_count = b_count + 1

print(min(w_count, b_count))