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

count_black = 0
count_white = 0
result_list = []

for i in range(n):
    for j in range(i + 1):
        if s[j] == "#":
            count_black += 1
    for k in range(n - i - 1):
        if s[k + i + 1] == ".":
            count_white += 1
    Sum = count_black + count_white
    result_list.append(Sum)
    count_black = 0
    count_white = 0

result = min(result_list)

print(result)
