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

count_black = 0
count_white = 0
cnt_white = [0] * n
cnt_black = [0] * n
result = []

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

for i in range(n):
    if s[i] == "#":
        count_black += 1
    else:
        count_white -= 1
    cnt_white[i] = count_white
    cnt_black[i] = count_black

for i in range(n):
    result.append(cnt_black[i] + cnt_white[i])

ans = min(result)

print(ans)
