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

count_list = []

for i in range(n):
    black = 0
    white = 0
    for j in range(i):
        if s[j] == '#':
            black += 1
    for j in range(i, n):
        if s[j] == '.':
            white += 1
    count_list.append(black + white)

print(min(count_list))