N = int(input())
S = input()

count_if_all_white     = 0
count_if_contain_black = 0

found_black = False
for c in S:
    if c == "#":
        found_black = True
        count_if_all_white += 1
    if found_black and c == ".":
        count_if_contain_black += 1

print(min(count_if_all_white, count_if_contain_black))