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

count_if_all_white = 0
for c in S:
    if c == "#":
        count_if_all_white += 1

count_if_contain_black = None
for i in range(len(S)+1):
    l_count = sum([1 for c in S[0:i] if c == "#"])
    r_count = sum([1 for c in S[i:len(S)+1] if c == "."])
    count = l_count + r_count
    if not count_if_contain_black:
        count_if_contain_black = count
    else:
        count_if_contain_black = min(count_if_contain_black, count)

print(min(count_if_all_white, count_if_contain_black))